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
releaseObjectLocks | if 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
- If this method is not called before EndTransaction or CloseDatabase, then the transaction is aborted.
- Then releaseObjectLocks is set true, the object within the table handles are removes so any call to ReadObject or DeleteObject using ODBPP.NEXT or ODBPP.PREVIOUS will fail.
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, EndTransactionListen All
Comments (0)