Subject | RE: [firebird-support] get_lock / release_lock |
---|---|
Author | Helen Borrie |
Post date | 2008-07-31T08:21Z |
At 05:45 PM 31/07/2008, you wrote:
./heLen
>I have an old app: vfp + odbc + mysql.That is how Firebird works - automatically. Replace this get_lock() mechanism with an exception routine and it is done.
>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.
>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.".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.
>
>I need RDB$SET_CONTEXT / RDB$GET_CONTEXT but in a global context.
./heLen