public abstract class DataTransaction
extends java.lang.Object
Abstract base class for objects that manage transaction boundaries.
Constructor and Description |
---|
DataTransaction() |
Modifier and Type | Method and Description |
---|---|
abstract void |
begin()
Begin a transaction.
|
abstract void |
commit()
Commit the current transaction.
|
abstract boolean |
isActive()
Return is a transaction currently active?
|
boolean |
isNested()
Return is the current transaction nested?
|
abstract boolean |
isRollbackOnly()
Return if there is an active transaction, is it marked for rollback only?
|
abstract void |
rollback()
Rollback the current transaction.
|
abstract void |
setRollbackOnly()
Mark the current transaction for rollback.
|
public abstract void begin()
Begin a transaction.
Nested transactions are permitted. Each call to begin
must be matched by a corresponding call to DataTransaction.commit
or DataTransaction.rollback
.
DataTransactionException
if a transaction cannot be started.
public abstract void commit()
Commit the current transaction. If the current transaction is marked for rollback only, it will be rolled back.
DataTransactionException
if there is no current transaction, or if commit fails.
public abstract boolean isActive()
Return is a transaction currently active?
public boolean isNested()
Return is the current transaction nested?
public abstract boolean isRollbackOnly()
Return if there is an active transaction, is it marked for rollback only?
public abstract void rollback()
Rollback the current transaction.
If the current transaction is a nested transaction, this calls DataTransaction.setRollbackOnly
.
DataTransactionException
if there is no current transaction, or if commit fails.
public abstract void setRollbackOnly()
Mark the current transaction for rollback.
DataTransactionException
if there is no current transaction.