+I(Berkeley DB: DbTxn::abort[P

DbTxn::abort





#include <db_cxx.h>

intDbTxn::abort();





Description



JThe DbTxn::abort method causes an abnormal termination of the transaction.EThe log is played backwards and any necessary recovery operations areyinitiated through the recover function specified to DbTxnMgr::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.pAs is the case for DbTxn::commit, applications that require strict:two-phase locking should not explicitly release any locks.

The DbTxn::abort>method either returns errno or throws an exception that:encapsulates an errno on failure, and 0 on success.



Errors

SIf a fatal error occurs in Berkeley DB, the DbTxn::abort method may fail and eitherIreturn DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY,Gat which point all subsequent database calls will also fail in the sameFway. Methods marked as returning errno will, by default, throwHan exception that encapsulates the error information. The default error\behavior can be changed, see DbException.

The DbTxn::abort&method may fail and throw an exceptionKfor 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),>DbLockTab::vec,6DbLog::get, memset(3), strerror(3), vfprintf(3),and vsnprintf(3).

In addition, the DbTxn::abort&method may fail and throw an exceptionor return errnofor the following conditions:

5

EINVAL
The transaction was already aborted.




Class

2DbTxn



See Also

DbTxn::abort,<DbTxn::commit,3DbTxn::idand>DbTxn::prepare.
ÿÿ