Next: , Previous: Database operations, Up: Functions


5.2.4 Transaction handling

— Function: Library Function AVLDB_IFTYPE tnxh avldb_tnx_new()

The avldb_tnx_new function creates new transaction and returns handle to it.

Returns new transaction handle tnxh. This funtions is “malloc like” non return-if-failure. See See Functions.

If you feel brave, you may start more than one transaction per process/thread, it may works, but this feature is poorly tested.

— Function: Library Function int avldb_tnx_end (AVLDB_IFTYPE tnxh )

The avldb_tnx_end function flushes all dirty blocks found in the transaction to a disk and clears the transaction's infrastructure. The tnxn argument specifies which transaction to terminate, tnxn is a handle created by avldb_tnx_new.

Returns NULL if argument is invalid, TRUE in the case of success .

— Function: Library Function AVLDB_IFTYPE avldb_tnx_abort ( AVLDB_IFTYPE tnxh)

The avldb_tnx_abort function drops all dirty blocks found in the transaction and try to apply before-image of transaction to undo all modifications in the scope of transaction. When database in running without before-image no undo is possible.

Returns NULL if argument is invalid, TRUE in the case of success .

— Function: Library Function AVLDB_IFTYPE avldb_tnx_redo ( AVLDB_IFTYPE dbh, char * AI_name)

The avldb_tnx_redo function redoes all transaction recorded in file pointed by AI_name. When everything went flawlessly database identified by dbh is changed to same state as the database in which file AI_name comes from, in other worlds “all complete transactions recorded in file AI_name are re-executed “.

Returns NULL if argument is invalid, TRUE in the case of success .