Trying to understand record locks

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Oct 17 10:42:24 CDT 2003


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
-------------------------------------------------------------



More information about the Valentina mailing list