|
Oracle® Data Integrator Java API Reference 11g Release 1 (11.1.1.5.0) E17060-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.odi.core.persistence.transaction.support.DefaultTransactionDefinition
oracle.odi.core.persistence.transaction.support.TransactionTemplate
public class TransactionTemplate
Template class that simplifies programmatic transaction demarcation and transaction exception handling against an ITransactionManager
.
The central method is execute(ITransactionCallback)
, supporting transactional code that implements the ITransactionCallback
interface. This template handles the transaction lifecycle and possible exceptions such that neither the ITransactionCallback
implementation nor the calling code needs to explicitly handle transactions.
Subclass DefaultTransactionDefinition
to support setting the name of the transaction and propagation behavior.
ITransactionCallback
Field Summary |
---|
Fields inherited from interface oracle.odi.core.persistence.transaction.ITransactionDefinition |
---|
PROPAGATION_MANDATORY, PROPAGATION_NEVER, PROPAGATION_NOT_SUPPORTED, PROPAGATION_REQUIRED, PROPAGATION_REQUIRES_NEW, PROPAGATION_SUPPORTS, TIMEOUT_DEFAULT |
Constructor Summary | |
---|---|
TransactionTemplate(ITransactionManager pTransactionManager) Construct a new TransactionTemplate using the given transaction manager. |
|
TransactionTemplate(ITransactionManager pTransactionManager, ITransactionDefinition pDefinition) Construct a new TransactionTemplate using the given transaction manager. |
Method Summary | |
---|---|
java.lang.Object |
execute(ITransactionCallback pAction) Execute the action specified by the given callback object within an ODI transaction. |
Methods inherited from class oracle.odi.core.persistence.transaction.support.DefaultTransactionDefinition |
---|
getExtendedPersistentContext, getName, getPropagationBehavior, getTimeout, setExtendedEntityManager, setName, setPropagationBehavior, setTimeout |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TransactionTemplate(ITransactionManager pTransactionManager)
TransactionTemplate
using the given transaction manager.pTransactionManager
- the transaction managerpublic TransactionTemplate(ITransactionManager pTransactionManager, ITransactionDefinition pDefinition)
TransactionTemplate
using the given transaction manager.pTransactionManager
- the transaction managerpDefinition
- the transaction definitionMethod Detail |
---|
public java.lang.Object execute(ITransactionCallback pAction)
Allows for returning a result object created within the transaction, that is, an ODI entity or a collection of ODI entities. A RuntimeException thrown by the callback is treated as a fatal exception that enforces a rollback. Such an exception gets propagated to the caller of the template.
pAction
- the callback object that specifies the transactional actionnull
|
Oracle® Data Integrator Java API Reference 11g Release 1 (11.1.1.5.0) E17060-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |