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


ASession.Begin();

try {

ADatabase.AddTable("custmast", "");

Console.Write("\nTable added to database.");

ASession.Commit();

}

catch (CTException err)

{

ASession.Abort();

Console.Write("\n\n{0} {1}",err.GetErrorCode(), err.GetErrorMsg());

}

See Also

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

TOCIndex