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();

printf("Commit transaction failed with error %d\n", err.GetErrorCode());

}

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

TOCIndex