com.adobe.idp.dsc.transaction
Interface TransactionContext


public interface TransactionContext

This interface provides access to contextual information around the current executing transaction. A TransactionContext is passed as a parameter to TransactionCallback.doInTransaction().


Method Summary
 boolean isCompleted()
          Determines whether this transaction is completed, meaning that it has already been committed or rolled back.
 boolean isNewTransaction()
          Determines if the transaction is new or is participating in an existing transaction.
 boolean isRollbackOnly()
          Determines if the transaction has been set rollback-only.
 void setRollbackOnly()
          Sets the transaction to rollback-only, which communicates to the transaction manager that the only possible outcome of the transaction may be a rollback.
 

Method Detail

isNewTransaction

boolean isNewTransaction()
Determines if the transaction is new or is participating in an existing transaction.

Returns:
true if the transaction is new, false otherwise.

setRollbackOnly

void setRollbackOnly()
Sets the transaction to rollback-only, which communicates to the transaction manager that the only possible outcome of the transaction may be a rollback.

For transactions managed by TransactionTemplate, an alternative way to trigger a rollback is throwing an application exception.


isRollbackOnly

boolean isRollbackOnly()
Determines if the transaction has been set rollback-only.

Returns:
true if the transaction has been set rollback-only, false otherwise.

isCompleted

boolean isCompleted()
Determines whether this transaction is completed, meaning that it has already been committed or rolled back.

Returns:
true if this transaction is completed, false otherwise.