Product Documentation

c-treeDB API for C# - Developers Guide

Previous Topic

Next Topic

Check if a Record is Locked

Call CTRecord.GetRecordLock() to retrieve the current lock mode acquired for the current record. If the record is not locked, CTRecord.GetRecordLock() returns LOCK_MODE.FREE_LOCK. If the current record is locked, CTRecord.GetRecordLock() returns the record lock mode.

// check if record is locked

if (ARecord.GetRecordLock() != LOCK_MODE.FREE_LOCK)

{

Console.Write("The record is locked\n");

}

The following record modes are returned by CTRecord.GetRecordLock() and are defined in the LOCK_MODE enum:

Lock Mode

Explanation

FREE_LOCK

The record is not locked

READ_LOCK

The record has a read lock

WRITE_LOCK

The record has a write lock

TOCIndex