Subject RE: [firebird-support] get_lock / release_lock
Author Doru Constantin
So, you say that I can modify for 30 minutes a document and then I try to
see if I can commit the changes?
I need to know that I can comit the changes before I begin to modify the
doc. It is like pessimistic locking but without any record lock.


-----Original Message-----
[] On Behalf Of Helen Borrie
Sent: 31 iulie 2008 11:21
Subject: RE: [firebird-support] get_lock / release_lock

At 05:45 PM 31/07/2008, you wrote:
>I have an old app: vfp + odbc + mysql.
>I try to replace mysql with minimal change in code.
>In this app when a user is add/modify/delete a document the get_lock()
>function is called and if the lock is get then the user can continue
>otherwise don't.

That is how Firebird works - automatically. Replace this get_lock()
mechanism with an exception routine and it is done.

>I read about RDB$SET_CONTEXT / RDB$GET_CONTEXT, but "... variables may be
read and written to and by whom are determined by namespace which they
belong to.".
>I need RDB$SET_CONTEXT / RDB$GET_CONTEXT but in a global context.

No, you don't. Each transaction works inside its own context. A
transaction knows when it has a lock (and when it hasn't). All your
application has to do is try the operation: if it succeeds then it has the
lock; if it fails, then it is denied the lock.




Visit and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at

Yahoo! Groups Links