Subject Re: [firebird-support] Locking mechanisms
Author Ann Harrison
At November 20, 2003, 10:07, Sandy wrote:

>>To put it another way, transaction A starts editing a record. While this is
>>going on, transaction B opens the same record and makes a change, and
>>commits. Later on, transaction A finally commits, overwriting the work of
>>transaction B.
>>
>>I am accustomed to solving this sort of problems with locks, but from what
>>I've read, Firebird doesn't support much in the way of locking. Does anyone
>>know the solution to this of problem?
>>
Daniel Rail wrote:

> Firebird 1.5 has introduced locking capability. You can read about it
> in the release notes for FB 1.5. You can get the release notes here:
> http://www.ibphoenix.com/downloads/Firebird_v15.106_ReleaseNotes.pdf

Which transaction do you want to fail? From your example, I'd guess that you'd rather have B succeed and A fail, which is not what will happen with locking. If that _is_ what you want, use the repeatable read transaction mode. If you want A to succeed and B to fail, use record locking.

Regards,

Ann