CommitTransaction

CommitTransaction executes the transaction log file, releasing all object locks if releaseObjectLocks is true else the current transaction will retain all the objects lock making CommitTransaction funtion like a save point.
unsigned int CommitTransaction(
   bool releaseObjectLocks = true
);

Parameters

releaseObjectLocksif this is set to false, this method acts as a save point, committing all adds, edits and deletes, but not releasing any object locks.

Return Values

If the method succeeds, the return value is zero else see error codes for more details.

Remarks

Example Use
char16_t *message;
CODBPP::Object object;
struct FixedObject{
   int First;
   double Second;
} *fixedObject;
unsigned int tableID = 1;
if((error = database.BeginTransaction()) == NO_ERROR
&& (error = database.OpenTable(tableID)) == NO_ERROR
&& (error = database.NewObject(tableID,&object)) == NO_ERROR){
   fixedObject = (struct FixedObject*)object.fixed;
   fixedObject->First = 456;
   fixedObject->Second = 456.789;
   if((error = database.AddObject(tableID)) == NO_ERROR){
      error = database.CommitTransaction();
}
if(error && database.GetErrorMessage(&message) == NO_ERROR)
   MessageBox(message);
database.EndTransaction();

Also See

AbortTransaction, BeginTransaction, EndTransaction
Comments (0)Listen All
Characters left: 2500
 
Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript