Skip navigation links

Oracle® Data Integrator Java API Reference
11g Release 1 (11.1.1.7.0)

E17060-04


oracle.odi.core.persistence.transaction.support
Class TransactionManagerSpringAdapter

java.lang.Object
  extended by oracle.odi.core.persistence.transaction.support.TransactionManagerSpringAdapter

All Implemented Interfaces:
ITransactionManager

public class TransactionManagerSpringAdapter
extends java.lang.Object
implements ITransactionManager

Implementation of ITransactionManager interface that delegates to a Spring transaction manager.

Since:
11.1.1.3.0

Constructor Summary
TransactionManagerSpringAdapter(org.springframework.transaction.PlatformTransactionManager pSpringTransactionManager, IOdiEntityManagerFactory pOdiEntityManagerFactory)
          Create a new TransactionManagerSpringAdapter.

 

Method Summary
 void commit(ITransactionStatus pStatus)
          Commit the given transaction, with regard to its status.
 ITransactionStatus getTransaction(ITransactionDefinition pDefinition)
          Obtains the currently active transaction or create a new one according to the given transaction definition (containing a propagation behavior).
 void rollback(ITransactionStatus pStatus)
          Perform a rollback of the given transaction.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

TransactionManagerSpringAdapter

public TransactionManagerSpringAdapter(org.springframework.transaction.PlatformTransactionManager pSpringTransactionManager,
                                       IOdiEntityManagerFactory pOdiEntityManagerFactory)
Create a new TransactionManagerSpringAdapter.
Parameters:
pSpringTransactionManager - Spring transaction manager to delegate
pOdiEntityManagerFactory - entity manager factory to manage resources from

Method Detail

commit

public void commit(ITransactionStatus pStatus)
Description copied from interface: ITransactionManager
Commit the given transaction, with regard to its status. If the transaction has been marked rollback-only programmatically, perform a rollback.

If the transaction wasn't a new one, omit the commit for proper participation in the surrounding transaction. If a previous transaction has been suspended to be able to create a new one, resume the previous transaction after committing the new one.

Note that when the commit call completes, no matter if normally or throwing an exception, the transaction must be fully completed and cleaned up. No rollback call should be expected in such a case. If this method throws an exception other than a TransactionException, then some before-commit error caused the commit attempt to fail. For example, an O/R Mapping tool might have tried to flush changes to the database right before commit, with the resulting DataAccessException causing the transaction to fail. The original exception will be propagated to the caller of this commit method in such a case.

Specified by:
commit in interface ITransactionManager
Parameters:
pStatus - object returned by the getTransaction method

rollback

public void rollback(ITransactionStatus pStatus)
Description copied from interface: ITransactionManager
Perform a rollback of the given transaction.

If the transaction wasn't a new one, just set it rollback-only for proper participation in the surrounding transaction. If a previous transaction has been suspended to be able to create a new one, resume the previous transaction after rolling back the new one.

Do not call rollback on a transaction if commit threw an exception. The transaction will already have been completed and cleaned up when commit returns, even in case of a commit exception. Consequently, a rollback call after commit failure will lead to an IllegalTransactionStateException.

Specified by:
rollback in interface ITransactionManager
Parameters:
pStatus - object returned by the getTransaction method

getTransaction

public ITransactionStatus getTransaction(ITransactionDefinition pDefinition)
Description copied from interface: ITransactionManager
Obtains the currently active transaction or create a new one according to the given transaction definition (containing a propagation behavior).

If the given definition is null, then a default definition (with default propagation and isolation) will be used.

Note that parameters like isolation level or timeout will only be applied to new transactions, and thus be ignored when participating in active ones.

Specified by:
getTransaction in interface ITransactionManager
Parameters:
pDefinition - ITransactionDefinition instance (can be null for defaults), describing propagation behavior, name, etc
Returns:
transaction status object representing the new or current transaction

Skip navigation links

Oracle® Data Integrator Java API Reference
11g Release 1 (11.1.1.7.0)

E17060-04


Copyright © 2010, 2013, Oracle and/or its affiliates. All rights reserved.