Commit Commit the current transaction in progress. Short Name TRANEND() Type Low-level data file function Declaration COUNT Commit(COUNT mode) Description Commits all file updates for files that support transactions, which means that the updates go to the data files from the preimage buffers. The mode parameter can take on values from the following table.
Note: If an update error has occurred, such as an AddRecord() failing due to a duplicate key, Commit() returns a PNDG_ERR (94) error and aborts the transaction. Return
See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values. Example Begin(ctENABLE | ctTRNLOG); /* Start transaction with locks */
{
if (add_master() < 0) {
printf(Error adding record.\n"); Abort(); /* Abort if can't add master rec. */ return(-1); } dodetail(); /* Process detail records */ } if (Commit(ctFREE) > 0) printf("\nError %d in transaction",uerr_cod);
See also Abort(), AbortXtd(), Begin(), ClearSavePoint(), RestoreSavePoint(), SetSavePoint(), TRANRDY() For a full description of transaction processing, see the “Data Integrity” in the c-tree Plus Programmer’s Reference Guide. |
||||||||||||||||||||||||||||