Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTBase::Begin

Syntax

void Begin ( )

Parameters

This method has no parameters.

Description

Marks the beginning of a transaction. If all the operations intended for the particular transaction are finished correctly, use Commit() to commit the transaction. Otherwise, use Abort() to abort the transaction.

The Begin() method does not lock or set the flags to lock any records. In order to request the lock of the records to be updated inside the transaction, the Lock() or CTRecord::LockRecord() should be used.

Return

None.

Example


pSession->Begin;

try {

pDatabase->AddTable("custmast", "");

printf("\nTable added to database.");

pSession->Commit;

}

catch (CTException& err)

{

Abort( );

printf("\n\n%d %s",err.GetErrorCode, err.GetErrorMsg);

}


See also

Abort(), Commit(), IsTransActive(), Lock()

TOCIndex