Methods Summary |
---|
public void | begin()Begin a new transaction.
|
public void | commit()Flush the associated Session and end the unit of work (unless
we are in {@link FlushMode#NEVER}.
This method will commit the underlying transaction if and only
if the underlying transaction was initiated by this object.
|
public boolean | isActive()Is this transaction still active?
Again, this only returns information in relation to the
local transaction, not the actual underlying transaction.
|
public void | registerSynchronization(javax.transaction.Synchronization synchronization)Register a user synchronization callback for this transaction.
|
public void | rollback()Force the underlying transaction to roll back.
|
public void | setTimeout(int seconds)Set the transaction timeout for any transaction started by
a subsequent call to begin() on this instance.
|
public boolean | wasCommitted()Check if this transaction was successfully committed.
This method could return false even after successful invocation
of {@link #commit}. As an example, JTA based strategies no-op on
{@link #commit} calls if they did not start the transaction; in that case,
they also report {@link #wasCommitted} as false.
|
public boolean | wasRolledBack()Was this transaction rolled back or set to rollback only?
This only accounts for actions initiated from this local transaction.
If, for example, the underlying transaction is forced to rollback via
some other means, this method still reports false because the rollback
was not initiated from here.
|