cursor/api

Ralf Sander ralf at end-if.de
Thu Feb 10 01:55:42 CST 2005


Am 10.02.2005 um 01:37 schrieb Ruslan Zasukhin:

> On 2/10/05 1:42 AM, "Ralf Sander" <ralf at end-if.de> wrote:
>
>> Api way:
>> The new api way is much more flexible, Adding records to a found set,
>> sorting etc.
>> But:
>> Because its all based on RecIDs, which will be reused, does this work
>> in an multiuser invironment?
>
> 1) I see only one problem:
>
>     API way do not have yet record locks.
>     I think we need add yet Vtable.Lock()  .Unlock()  functions.
>
> Ralf, it is not good idea do not use locks in the mutli-user 
> environment.

I thougth, I could create my own lock:
try to write to "lock" field of record, if "lock" field is empty and no 
write error, write username to lock field of record...



>
>
> 2) actually Cursor also is based on RecID, just you not see this.
>     and cursor can/should lock selected records.
But a deleted record does no longer contain any data in the cursor, 
even if the rec id is reused. Is there any build in check?


>
>
>> Example:
>>
>> mDataBase.mPerson.Field("string_fld").FindContains("aa") returns a 
>> Vset
>> with 10 records, which I use for displaying.
>> If I delete the first record with mDataBase.mPerson.DeleteRecord, the
>> iterator still loopes 10 times returning the value of record 2 for the
>> deleted record 1.
> In loop you should do safe check
>
>     if( Table.RecordExist( recID ) )
Ok, but the rec id is reused, so I will have to check for record 
creation date or something like that.
>
>
Cheers,
Ralf



More information about the Valentina-beta mailing list