SQL/MX 2.x Reference Manual (G06.24+, H06.03+)
Introduction
HP NonStop SQL/MX Reference Manual—523725-004
1-10
Lock Holder
SHARE lock mode allows multiple users to lock and read the same data. EXCLUSIVE
lock mode limits access to locked data to the lock holder and to other users who
specify READ UNCOMMITTED (but not READ COMMITTED or SERIALIZABLE)
access. Lock modes are the same when you choose READ COMMITTED or
SERIALIZABLE access.
Lock mode is sometimes determined by NonStop SQL/MX. NonStop SQL/MX ensures
that an exclusive lock is in effect for write operations and usually acquires a shared
lock for operations that access data without modifying it. You choose lock mode in
these instances:
•
On the LOCK TABLE statement, you can choose either EXCLUSIVE or SHARE.
•
On the SELECT statement, you can specify IN EXCLUSIVE MODE or IN SHARE
MODE.
Lock Holder
The lock holder of an object depends on whether the object is audited or nonaudited:
•
Locks on audited objects are held by the transaction in which the request to access
the data was made.
•
Locks on nonaudited objects are held by the process that opens the object: either
MXCI or a host program.
Only the lock holder can release a lock:
•
A transaction releases the locks it holds at the end of the transaction in either of
these cases:
°
Locks on data read using SERIALIZABLE access
°
Locks on rows updated
•
A process can hold a lock over the duration of one (or more) transactions, or the
process can release the lock before the transaction completes. A process releases
the locks it holds by issuing statements that affect the locks.
Stopping or abnormal termination of a process frees any locks the process holds on
nonaudited tables.