Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTBase::GetKeepLock

Syntax

CTKEEP_MODE CTBase::GetKeepLock();

Parameters

This method has no parameters.

Description

When a transaction is terminated by calling either the CTBase::Commit() or CTBase::Abort() function, all locks are automatically freed, including the locks acquired outside the transaction. An application might want to control which locks are kept when the transaction ends. To support this ability, c-treeDB introduced a function to control how locks are handled when a transaction terminates.

CTBase::GetKeepLock() returns the current keep lock status.

Return

Value

Symbolic Constant

Explanation

0

CTKEEP_FREE

Release all locks. Clear LKISAM state, turning off session-wide record locking. This is the default mode.

1

CTKEEP_LOCK

Keep all locks acquired before and during transaction, leaving session-wide record locking as it was. The LKISAM state is not cleared.

2

CTKEEP_OUT

Release only locks obtained within transaction and/or locks on records updated within transaction. The LKISAM state is not cleared, leaving session-wide record locking as it was.

3

CTKEEP_OUTALL

Unconditionally keep all locks acquired before transaction began. Free locks obtained within the transaction. The LKISAM state is not cleared, leaving session-wide record locking as it was.

See also

CTBase::Abort(), CTBase::Begin(), CTBase::Commit(), CTBase:::SetKeepLock()

TOCIndex