Access modes

When you open a smart large object, you specify the access mode for the data.

The access mode determines which read and write operations are valid on the open smart large object. You specify an access mode with one of the access-mode constants that the locator.h file defines.

The following table shows the access modes and their corresponding defined constants that the ifx_lo_open() and ifx_lo_create() functions support.

Table 1. Access-mode flags for smart large objects
Access mode Purpose Access-mode constant
Read-only mode Only read operations are valid on the data. LO_RDONLY
Dirty-read mode For ifx_open() only, allows you to read uncommitted data pages for the smart large object. You cannot write to a smart large object after you set the mode to LO_DIRTY_READ. When you set this flag, you reset the current transaction isolation mode to dirty read for the smart large object.

Do not base updates on data that you obtain from a smart large object in dirty-read mode.

LO_DIRTY_READ
Write-only mode Only write operations are valid on the data. LO_WRONLY
Append mode Intended for use with LO_WRONLY or LO_RDWR. Sets the location pointer to the end of the object immediately before each write. Appends any data you write to the end of the smart large object. If LO_APPEND is used alone, the object is opened for reading only. LO_APPEND
Read/write mode Both read and write operations are valid on the data. LO_RDWR
Buffered access Use standard database server buffer pool. LO_BUFFER
Lightweight I/O Use private buffers from the session pool of the database server. LO_NOBUFFER
Lock all Specify that locking will occur for an entire smart large object. LO_LOCKALL
Lock byte range Specify that locking will occur for a range of bytes, which will be specified through the ifx_lo_lock() function when the lock is placed. LO_LOCKRANGE
Tip: These access-mode flags for a smart large object are patterned after the UNIX™ System V access modes.