,I)Berkeley DB: DbTxn::commit[P

DbTxn::commit





#include <db_cxx.h>

intDbTxn::commit();





Description



IThe DbTxn::commit method ends the transaction specified by the tid argument.

FIf DB_TXN_NOSYNC was not specified, a commit log record is written and;flushed to disk, as are all previously written log records.

BIf the transaction is nested, its locks are acquired by the parent.transaction, otherwise its locks are released.7Note: nested transactions are not yet supported.

GAny applications that require strict two-phase locking must not releaseGany locks explicitly, leaving them all to be released by DbTxn::commit.

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



Errors

TIf a fatal error occurs in Berkeley DB, the DbTxn::commit 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::commit&method may fail and throw an exceptionKfor any of the errors specified for the following Berkeley DB and C library functions: abort(3), fcntl(3), fflush(3), fprintf(3),free(3), getpid(3),>DbLockTab::vec,6DbLog::put, malloc(3), memcpy(3), memset(3), strerror(3), vfprintf(3),and vsnprintf(3).

In addition, the DbTxn::commit&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.
ÿÿ