Product Documentation

c-treeDB API for C# - Developers Guide

Previous Topic

Next Topic

Terminating a Transaction

When all update operations have been completed, terminate a transaction by calling the Commit() method to commit all changes.


// Start transaction

ARecord.Begin();


// write the record

try

{

ARecord.Write();

ARecord.Commit();

}

catch (CTException err)

{

ARecord.Abort();

Console.Write("Commit transaction failed with error {0}\n", err.GetErrorCode());

}


Call Abort() to terminate the transaction and abort all changes since the start of the transaction.

TOCIndex