Informix Error -12126: Smart Large Objects: LO is not opened for byte range locking.
Cause and resolution
Smart Large Objects: LO is not opened for byte range locking.
A call to one of the byte-range locking functions has attempted to specify a byte-range lock:
* ESQL/C: ifx_lo_lock() or ifx_lo_unlock()
* DAPI: mi_lo_lock() or mi_lo_unlock()
The smart large object is currently opened for locking at the whole-object level.
Close the smart large object, then reopen the smart large object with the LO_LOCKRANGE (ESQL/C) or MI_LO_LOCKRANGE (DAPI) lock-mode flag set.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-12126 fires when ifx_lo_lock()/ifx_lo_unlock() (ESQL/C) or mi_lo_lock()/
mi_lo_unlock() (DAPI) is called with a byte-range lock while the object is opened for
whole-object locking — per the official guidance.
- The smart large object currently opened for whole-object-level locking, per the official guidance — the direct, only cause.
Solutions / Resolution
- Close the smart large object, then reopen it with the
LO_LOCKRANGE(ESQL/C) orMI_LO_LOCKRANGE(DAPI) lock-mode flag set, per the official guidance.
Examples
N/A
No specific triggering statement is documented beyond a byte-range lock on a whole-object- locked handle.
Diagnostic Checks
- Check the lock mode the object was opened with, and reopen it with
LO_LOCKRANGE/MI_LO_LOCKRANGEif byte-range locking is needed.
Related Errors / Related Topics
- -12127 — "Smart Large Objects: Invalid range size in byte range lock / unlock call." A related byte-range-locking error, on the range size argument rather than the lock mode.
- -12128 — "Smart Large Objects: Invalid offset in byte range lock / unlock call." A related byte-range-locking error, on the offset argument rather than the lock mode.
A byte-range lock was attempted on an object opened for whole-object locking — reopen it with the range lock-mode flag set.