#include <db.h> int DB_TXN->discard(DB_TXN *tid, u_int32_t flags);
The DB_TXN->discard()
method frees up all the per-process resources
associated with the specified DB_TXN handle, neither
committing nor aborting the transaction. This call may be used only
after calls to
DB_ENV->txn_recover()
when
there are multiple global transaction managers recovering transactions
in a single Berkeley DB environment. Any transactions returned by
DB_ENV->txn_recover()
that are not handled by the current global transaction manager should
be discarded using DB_TXN->discard()
.
All open cursors in the transaction are closed and the first cursor close error, if any, is returned.
The DB_TXN->discard()
method returns a non-zero error value on failure and 0 on success.
The errors values that this method returns include the error values of DBcursor->close()
and the following:
A Berkeley DB Concurrent Data Store database environment configured for lock timeouts was unable to grant a lock in the allowed time.
You attempted to open a database handle that is configured for no waiting exclusive locking, but the exclusive lock could not be immediately obtained. See DB->set_lk_exclusive() for more information.
After DB_TXN->discard()
has been called, regardless of its return,
the DB_TXN handle may not
be accessed again.
The DB_TXN->discard()
method may fail and return one of the following non-zero errors: