Returns a pointer to the current operation's lock handle.
When used with
lock handle must first be requested with the
OO_LOCKHANDLE operation option. For other
operations, this method can be used alone. In any case, the
NdbLockHandle object returned by this method
cannot be used until the operation has been executed.
Using lock handle methods.
Shared or exclusive locks taken by read operations in a
transaction are normally held until the transaction commits or
aborts. Such locks can be released before a transaction commits
or aborts by requesting a lock handle when defining the read
operation. Once the read operation has been executed, an
NdbLockHandle can be used to create a new
unlock operation (with
the unlock operation is executed, the row lock placed by the
read operation is released.
The steps required to release these locks are listed here:
Define the primary key read operation in the normal way with lock mode
NdbTransaction::execute(); the row is now locked from this point on, as normal.
(Use data, possibly making calls to
NdbTransaction::unlock(), passing in the
const NdbLockHandleobtained previously to create an unlock operation.
NdbTransaction::execute(); this unlocks the row.
As with other operation types, unlock operations can be batched.
NdbLockHandleobject refers to a lock placed on a row by a single primary key read operation. A single row in the database may have concurrent multiple lock holders (mode
LM_Read) and may have multiple lock holders pending (
LM_Exclusive), so releasing the claim of one lock holder may not result in a change to the observable lock status of the row.
Lock handles are supported for scan lock takeover operations; the lock handle must be requested before the lock takeover is executed.
Lock handles and unlock operations are not supported for unique index read operations.
const NdbLockHandle* getLockHandle ( void ) const
const NdbLockHandle* getLockHandle ( void )