com.sleepycat.collections
public class CurrentTransaction extends Object
Method Summary | |
---|---|
Transaction | abortTransaction()
Aborts the transaction that is active for the current thread for this
environment and makes the parent transaction (if any) the current
transaction.
|
Transaction | beginTransaction(TransactionConfig config)
Begins a new transaction for this environment and associates it with
the current thread. |
Transaction | commitTransaction()
Commits the transaction that is active for the current thread for this
environment and makes the parent transaction (if any) the current
transaction.
|
Environment | getEnvironment()
Returns the underlying Berkeley DB environment. |
static CurrentTransaction | getInstance(Environment env)
Gets the CurrentTransaction accessor for a specified Berkeley DB
environment. |
Transaction | getTransaction()
Returns the transaction associated with the current thread for this
environment, or null if no transaction is active. |
Returns: the parent transaction or null if the aborted transaction was not nested.
Throws: DatabaseException if an error occurs aborting the transaction. The transaction will still be closed and the parent transaction will become the current transaction. IllegalStateException if no transaction is active for the current thread for this environment.
Parameters: config the transaction configuration used for calling Environment, or null to use the default configuration.
Returns: the new transaction.
Throws: DatabaseException if the transaction cannot be started, in which case any existing transaction is not affected. IllegalStateException if a transaction is already active and nested transactions are not supported by the environment.
Returns: the parent transaction or null if the committed transaction was not nested.
Throws: DatabaseException if an error occurs committing the transaction. The transaction will still be closed and the parent transaction will become the current transaction. IllegalStateException if no transaction is active for the current thread for this environment.
Parameters: env is an open Berkeley DB environment.
Returns: the CurrentTransaction accessor for the given environment, or null if the environment is not transactional.