+I%Berkeley DB: txn_abort[P

txn_abort





#include <db.h>

inttxn_abort(DB_TXN *tid);





Description



IThe txn_abort function causes an abnormal termination of the transaction.EThe log is played backwards and any necessary recovery operations areqinitiated through the recover function specified to txn_open.KAfter recovery is completed, all locks held by the transaction are acquiredIby the parent transaction in the case of a nested transaction or released(in the case of a non-nested transaction.kAs is the case for txn_commit, applications that require strict:two-phase locking should not explicitly release any locks.

The txn_abortHfunction returns the value of errno on failure, and 0 on success.



Errors

RIf a fatal error occurs in Berkeley DB, the txn_abort function may fail and returnFDB_RUNRECOVERY, at which point all subsequent database calls will alsoreturn DB_RUNRECOVERY.

The txn_abort)function may fail and return errnoKfor any of the errors specified for the following Berkeley DB and C library functions:DBenv->tx_recover, abort(3), fcntl(3), fflush(3), fprintf(3),free(3), getpid(3),6lock_vec,1log_get, memset(3), strerror(3), vfprintf(3),and vsnprintf(3).

In addition, the txn_abort)function may fail and return errnofor the following conditions:

5

EINVAL
The transaction was already aborted.




See Also

txn_abort,8txn_begin,Btxn_checkpoint,8txn_close,7txn_commit,/txn_id,6txn_open,9txn_prepare,5txn_statand:txn_unlink.
ÿÿ