The Begin() method of classes CTSession, CTDatabase, CTTable and CTRecord starts a new transaction. Choose logical groups of file updates to be delimited as transactions.
Record locks are held on updated records for the duration of the transaction, so you don't want to make the transaction group too large or it will consume the system resources. On the other hand, you may not want to make the transaction group too small or the effect of grouping actions is lost.
Using our example from above, you don't want to have the transaction group involve more than one invoice. You also don't want it to involve less than a whole invoice.
// start a new transaction
try
{
ARecord.Begin()
}
catch (CTException err)
{
Console.Write("Begin transaction failed with error {0}\n", err.GetErrorCode());
}