Class JTATransactionController
- java.lang.Object
-
- org.eclipse.persistence.transaction.AbstractTransactionController
-
- org.eclipse.persistence.transaction.JTATransactionController
-
- All Implemented Interfaces:
ExternalTransactionController
- Direct Known Subclasses:
GlassfishTransactionController
,JBossTransactionController
,JotmTransactionController
,Oc4jTransactionController
,SAPNetWeaverTransactionController
,WebLogicTransactionController
,WebSphereTransactionController
public class JTATransactionController extends AbstractTransactionController
Purpose: TransactionController implementation for JTA 1.0
Description: Implements the required behavior for controlling JTA 1.0 transactions. Specific JTA implementations may need to extend this class when special controller behavior is necessary.
The JTA TransactionManager must be obtained and set on the instance in order for a Synchronization listener to be registered against the transaction. This can be done either by extending this class and defining acquireTransactionManager() to return the manager for the server, or by using this class and explicitly calling the setTransactionManager() method on it after the fact. e.g. TransactionManager mgr = controller.jndiLookup("java:comp/TransactionManager"); controller.setTransactionManager(mgr);
If a different listener needs to be used for synchronization, the SynchronizationListenerFactory should be set on the controller instance. The listener subclass should implement the factory interface, so that setting the factory is simply a matter of assigning an instance of the listener. e.g. controller.setSynchronizationListenerFactory( new DifferentServerSynchronizationListener()); The default listener factory creates instances of JTATransactionListener.
-
-
Constructor Summary
Constructors Constructor Description JTATransactionController()
PUBLIC: Return a new controller for use with a JTA 1.0 compliant TransactionManager.JTATransactionController(javax.transaction.TransactionManager transactionManager)
PUBLIC: Return a new controller for use with a JTA 1.0 compliant TransactionManager.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.transaction.TransactionManager
getDefaultTransactionManager()
javax.transaction.TransactionManager
getTransactionManager()
PUBLIC: Return the transaction manager used to control the JTA transactions.boolean
isRolledBack_impl(java.lang.Object status)
INTERNAL: Return true if the transaction is rolled back.static void
setDefaultTransactionManager(javax.transaction.TransactionManager defaultTransactionManager)
PUBLIC: Set the JTA transaction manager to be used.void
setTransactionManager(javax.transaction.TransactionManager mgr)
PUBLIC: Set the transaction manager used to control the JTA transactions.-
Methods inherited from class org.eclipse.persistence.transaction.AbstractTransactionController
addUnitOfWork, beginTransaction, bindToCurrentTransaction, clearSequencingListeners, commitTransaction, getActiveSequencingCallback, getActiveUnitOfWork, getExceptionHandler, getListenerFactory, getSession, getTransaction, getTransactionKey, getTransactionStatus, getUnitsOfWork, hasActiveUnitOfWork, initializeSequencingListeners, isSequencingCallbackRequired, jndiLookup, logTxStateTrace, logTxTrace, lookupActiveUnitOfWork, lookupActiveUnitOfWork, markTransactionForRollback, noTransactionOrRolledBackOrCommited, numSessionsRequiringSequencingCallback, registerSynchronizationListener, removeSequencingListener, removeUnitOfWork, rollbackTransaction, setExceptionHandler, setListenerFactory, setSession
-
-
-
-
Constructor Detail
-
JTATransactionController
public JTATransactionController()
PUBLIC: Return a new controller for use with a JTA 1.0 compliant TransactionManager.
-
JTATransactionController
public JTATransactionController(javax.transaction.TransactionManager transactionManager)
PUBLIC: Return a new controller for use with a JTA 1.0 compliant TransactionManager.
-
-
Method Detail
-
isRolledBack_impl
public boolean isRolledBack_impl(java.lang.Object status)
INTERNAL: Return true if the transaction is rolled back.- Specified by:
isRolledBack_impl
in classAbstractTransactionController
-
getTransactionManager
public javax.transaction.TransactionManager getTransactionManager()
PUBLIC: Return the transaction manager used to control the JTA transactions.- Returns:
- The JTA TransactionManager that is used to obtain transaction state information and control the active transaction.
-
setTransactionManager
public void setTransactionManager(javax.transaction.TransactionManager mgr)
PUBLIC: Set the transaction manager used to control the JTA transactions.- Parameters:
mgr
- A valid JTA TransactionManager that can be accessed by this controller to obtain transaction state information and control the active transaction.
-
getDefaultTransactionManager
public static javax.transaction.TransactionManager getDefaultTransactionManager()
-
setDefaultTransactionManager
public static void setDefaultTransactionManager(javax.transaction.TransactionManager defaultTransactionManager)
PUBLIC: Set the JTA transaction manager to be used. This can be called directly before login to configure JTA integration manually, or using Spring injection.
-
-