By default, the database server uses whole lock-all locks when it needs to lock a smart large object. Lock-all locks are an "all or nothing" lock; that is, they lock the entire smart large object. When the database server obtains an exclusive lock, no other user can access the data of the smart large object as long as the lock is held. (For more information on the default locking, see Locking Modes.)
If this locking is too restrictive for the concurrency requirements of your application, you can use byte-range locking instead of lock-all locking. With byte-range locking, you can specify the range of bytes to lock in the smart-large-object data. If other users access other portions of the data, they can still acquire their own byte-range lock.
You can specify the byte-range locking feature either when you create the smart large object or when you open it, as follows:
You can specify the LO_LOCKRANGE lock-mode constant as a default open flag for the new smart large object.
You can specify the LO_LOCKRANGE lock-mode constant in the open-mode argument of mi_lo_open( ).
The smart-large-object interface provides the following functions for handle lock requests of byte-range locks.
With the mi_lo_lock( ) function, you can specify the following information for the lock request of the byte-range lock: