Re: HELP!!! Pessimistic locking using ODBC
Posted in 1997
Systems Team wrote: > > Hi All, > I'm using Delphi2 with OpenLink multi-tier ODBC to link to an Informix 5 database. My > question is: > > How can I lock a row in a table? > > The Borland documentation suggests only optimistic locking can be done on SQL database > connections- but my users are likely to find this unacceptable. Is there a solution? There is no explicit SQL 'lock row' command. SQL transactions take an exclusive lock on each row which has been updated and an intent lock on any row which is fetched with the intent of updating later. An intent lock will prevent any other user from acquiring an exclusive lock but will not prevent anyone from acquiring another intent lock. Intent locks are promoted to exclusive locks when the row is updated. This is the only locking scheme that is available. Art S. Kagel