Berkeley DB: txn_abort
Description: Berkeley DB: An embedded database programmatic toolkit.
Keywords: embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++

# txn_abort |

`

###

    #include <db.h>

    int
    txn_abort(DB_TXN *tid);

# Description

The txn_abort function causes an abnormal termination of the transaction. The log is played backwards and any necessary recovery operations are initiated through the recover function specified to DBENV->open. After the log processing is completed, all locks held by the transaction are released. As is the case for txn_commit, applications that require strict two-phase locking should not explicitly release any locks.

In the case of nested transactions, if the transaction is a parent transaction with unresolved (neither committed or aborted) child transactions, txn_abort will fail, returning DB_UNRESOLVED_CHILD. In this case, the child transactions should be resolved, then the parent may be resolved.

Once the txn_abort function returns, other than under the conditions described for unresolved child transactions, the DB_TXN handle may not be accessed again.

The txn_abort function returns a non-zero error value on failure and 0 on success.

# Errors

The txn_abort function may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions. If a catastrophic error has occurred, the txn_abort function may fail and return DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.

# See Also

DBENV->set_tx_max, DBENV->set_tx_recover, DBENV->set_tx_timestamp, txn_abort, txn_begin, txn_checkpoint, txn_commit, txn_id, txn_prepare and txn_stat.`

Copyright Sleepycat Software