Smart-large-object locks

To prevent simultaneous access to smart-large-object data, the database server locks a smart large object when you open it.

Locks on smart large objects are different from row locks. If you retrieve a smart large object from a row, the database server might hold a row lock as well as a smart-large-object lock. The database server locks smart large objects because many columns can contain the same smart-large-object data.

To specify the lock mode of a smart large object, pass the access-mode flags, LO_RDONLY, LO_DIRTY_READ, LO_APPEND, LO_WRONLY, LO_RDWR, and LO_TRUNC, to the ifx_lo_open() and ifx_lo_create() functions. When you specify LO_RDONLY, the database server places a lock on the smart-large-object data. When you specify LO_DIRTY_READ, the database server does not place a lock on the smart-large-object data. If you specify any other access-mode flag, the database server obtains an update lock, which it promotes to an exclusive lock on first write or other update operation.

Share and update locks (read-only mode or write mode before an update operation occurs) are held until your application takes one of the following actions:
  • Closes the smart large object
  • Commits the transaction or rolls it back
Exclusive locks are held until the end of a transaction even if you close the smart large object.
Important: You lose the lock at the end of a transaction even if the smart large object remains open. When the database server detects that a smart large object does not have an active lock, it places a new lock the next time that you access the smart large object. The lock that it places is based on the original open mode of the smart large object.