Trying to understand record locks

James Kleinschmidt jkleins at shentel.net
Fri Oct 17 10:10:56 CDT 2003


In my testing I get a cursor (theCur) and store it in a global property 
with read/write locks. This is a good cursor
I then try to get another cursor (theNewCur) with the same data and it 
fails.
This seems right because that data is locked, right. But now it gets 
confusing.
If I get the same cursor (theCur) and store it in the global variable 
with no locks and then repeat the exact same select with read/write 
locks, just as I did in the first test, and store it in the same global 
-  theNewCur works fine and I can change the records in theNewCur 
successfully like the locks are not there.
Am I missing something real obvious here or should I be doing something 
differently?

Thanks for your help,

Jim
On Friday, October 17, 2003, at 03:42  AM, Ruslan Zasukhin wrote:

> on 10/17/03 5:28, James Kleinschmidt at jkleins at shentel.net wrote:
>
> Hi James,
>
>> I am just trying to get a handle on the record locking mechanism and
>> have a few questions after trying a few things.
>>
>> 1) How long is the lock on the record for? until the cursor is 
>> released
>> ?
>
> Yes.
>
>> 2) Is the lock just for different users? in other words if I get a
>> cursor with read/write locks and store it in a global property and 
>> then
>> update the record later using the baseobject.update methods should the
>> record accessed in the cursor  be locked and unable to change or is 
>> the
>> lock only for another user that tries to access that record from
>> another computer.
>
> First of all! you NEVER should MIX Cursors with BaseObject API.
>
> Answer is yes, Cursor have lock record physically on disk.
> So not via BaseObject, not via other cursor you cannot access that 
> record.
>
> You can consider record locks useful when you have
> A) many users
> B) many threads inside of your app. (threads play role of users)
>
>> 3) To use the locks should I always try to update using cursors or are
>> the baseobject methods for adding and updating okay as well?
>
> Always prefer cursors. Especially if you going in future use Vserver.
>
>> I appreciate any help. The test application I made just seems to 
>> ignore
>> any locks I try to set so I suspect I am just not understanding them
>> well enough. If there is anything written about this please direct me.
>> I haven't been able to find anything very specific in the docs.
>
> Record locks describe in Valentina Kernel.pdf
>
> Do you use 1.9.8 version? (I think yes.)
> Can you send me your test that show that locks are ignored?
>
> -- 
> Best regards,
> Ruslan Zasukhin      [ I feel the need...the need for speed ]
> -------------------------------------------------------------
> e-mail: ruslan at paradigmasoft.com
> web: http://www.paradigmasoft.com
>
> To subscribe to the Valentina mail list go to:
> http://lists.macserve.net/mailman/listinfo/valentina
> -------------------------------------------------------------
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>



More information about the Valentina mailing list