CommitTransaction

ODBPPLib.IODBPP.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.
void CommitTransaction(
   bool releaseObjectLocks
);

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

Remarks

Example Use
  • C#
public static uint FIRST_TABLE = 1;
private void button1_Click(object sender, EventArgs e){
   try{
      ODBPPLib.ODBPP odbpp = new ODBPPLib.ODBPP();
      odbpp.OpenDatabase("C:\\My\\Database\\Control\\File.odc");
      odbpp.BeginTransaction(odbpp.SHARED, 60000);
      odbpp.OpenTable(FIRST_TABLE);
      ODBPPLib.DatabaseObject obj = odbpp.NewObject(FIRST_TABLE);
      obj.WriteField("First", 456);
      obj.WriteField("Second", 456.789);
      odbpp.AddObject(FIRST_TABLE,0);
      odbpp.CommitTransaction(true);
      odbpp.EndTransaction();
   }
   catch (Exception e1){
      MessageBox.Show(e1.Message);
   }
}

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