Berkeley DB: DbTxn.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++

# DbTxn.abort |

`

###

    import com.sleepycat.db.*;

    public void abort()
    	throws DbException;

# Description

The DbTxn.abort method 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 DbTxn.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, DbTxn.abort will fail, throwing an exception that encapsulates Db.DB_UNRESOLVED_CHILD. In this case, the child transactions should be resolved, then the parent may be resolved.

Once the DbTxn.abort method returns, other than under the conditions described for unresolved child transactions, the DbTxn handle may not be accessed again.

The DbTxn.abort method throws an exception that encapsulates a non-zero error value on failure.

# Errors

The DbTxn.abort method may fail and throw an exception for errors specified for other Berkeley DB and C library or system methods. If a catastrophic error has occurred, the DbTxn.abort method may fail and throw a DbRunRecoveryException, in which case all subsequent Berkeley DB calls will fail in the same way.

### Classes

DbEnv, DbTxn

# See Also

DbEnv.set_tx_max, DbEnv.set_tx_timestamp, DbTxn.abort, DbEnv.txn_begin, DbEnv.txn_checkpoint, DbTxn.commit, DbTxn.id, DbTxn.prepare and DbEnv.txn_stat.`

Copyright Sleepycat Software