com.adobe.idp.dsc.transaction
Interface TransactionCallback

All Known Implementing Classes:
TransactionCallbackWithoutResult

public interface TransactionCallback

This is a callback interface for transactional code. A transaction callback is expected to be used with TransactionTemplate.execute(). Typically, the transaction callback is implemented as an anonymous class.


Method Summary
 java.lang.Object doInTransaction(TransactionContext aTxCtx)
          This method is called by TransactionTemplate.execute().
 

Method Detail

doInTransaction

java.lang.Object doInTransaction(TransactionContext aTxCtx)
                                 throws com.adobe.idp.dsc.DSCException
This method is called by TransactionTemplate.execute(). within a transactional context. It does not require information about the transactions themselves, although it can retrieve and influence the status of the current transaction through the given status object, by setting rollback-only.

It allows for returning a result object created within the transaction, meaning a domain object or a collection of domain objects. A runtime exception thrown by the callback is treated as application exception that enforces a rollback. An exception is propagated to the caller of the template.

Parameters:
aTxCtx - The associated transaction context.
Returns:
A result object.
Throws:
com.adobe.idp.dsc.DSCException
See Also:
TransactionTemplate.execute()