Product Documentation

c-treeDB API for C# - Developers Guide

Previous Topic

Next Topic

Record Locking

A record lock can be acquired by manually performing the following actions:

  1. Read a record from disk by calling one of the CTRecord.First(), CTRecord.Last(), CTRecord.Next(), CTRecord.Prev(), CTRecord.SeekRecord(), CTRecord.Find(), or CTRecord.FindTarget() methods.
  2. Lock the record by calling CTRecord.LockRecord().

Session-wide locks are better suited to data integrity than manual locks because it locks records as they are read from disk. A manual record lock can only be applied after the record has been read, manual locks leave a small window of opportunity for the record be modified or deleted by another thread before the record lock is acquired.

Release a record lock by calling CTRecord.UnlockRecord() or by calling CTRecord.LockRecord() with LOCK_MODE.FREE_LOCK mode.

In This Section

Check if a Record is Locked

Demoting Record Locks

TOCIndex