Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbUnlockTable

Releases all record locks associated with a table.

Declaration

CTDBRET ctdbUnlockTable(CTHANDLE Handle)

Description

ctdbUnlockTable() releases all record locks associated with the specified table, regardless of whether the records were automatically locked via the session-wide record locking mechanism (call ctdbLock() and then read a record), or manually locked by calling ctdbLockRecord() on an individual record. There is one exception to this - any new/modified/deleted records that were locked (via either of the locking methods) in a transaction, in a CTCREATE_TRNLOG / CTCREATE_PREIMG table, are NOT unlocked by this function. (But locks on records in a CTCREATE_NORMAL table ARE unlocked.) Later, when the transaction is finished (by calling ctdbCommit() or ctdbAbort()), the locks on those still-locked records will be released. This function has no effect on the session-wide record locking mode (it does not turn it on or off, or suspend it, etc.) Use ctdbUnlockRecord() to unlock just one record (with certain exceptions).

  • Handle [in] the Table, Record, Field, Index or Segment Handle.

Returns

ctdbUnlockTable() returns CTDBRET_OK on success, or c-treeDB API C API error code on failure.

See also

ctdbLockRecord(), ctdbUnlockRecord(), Locking

TOCIndex