Class JTATransactionWrapper
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.transaction.TransactionWrapperImpl
-
- org.eclipse.persistence.internal.jpa.transaction.JTATransactionWrapper
-
- All Implemented Interfaces:
TransactionWrapper
public class JTATransactionWrapper extends TransactionWrapperImpl implements TransactionWrapper
INTERNAL: JTA transaction wrapper. Allows the EntityManager to transparently use JTA vs local transactions.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.persistence.transaction.AbstractTransactionControllertxnController-
Fields inherited from class org.eclipse.persistence.internal.jpa.transaction.TransactionWrapperImpl
entityManager, localUOW, txnKey
-
-
Constructor Summary
Constructors Constructor Description JTATransactionWrapper(EntityManagerImpl entityManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectcheckForTransaction(boolean validateExistence)INTERNAL: This method will be used to check for a transaction and throws exception if none exists.voidclear()INTERNAL: Internal clear the underlying data structures that this transaction owns.javax.persistence.EntityTransactiongetTransaction()An ENtityTransaction cannot be used at the same time as a JTA transaction throw an exceptionbooleanisJoinedToTransaction(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)voidregisterIfRequired(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)voidsetRollbackOnlyInternal()INTERNAL: Mark the current transaction so that the only possible outcome of the transaction is for the transaction to be rolled back.protected voidthrowCheckTransactionFailedException()protected voidthrowUserTransactionException()-
Methods inherited from class org.eclipse.persistence.internal.jpa.transaction.TransactionWrapperImpl
getLocalUnitOfWork, setLocalUnitOfWork
-
-
-
-
Constructor Detail
-
JTATransactionWrapper
public JTATransactionWrapper(EntityManagerImpl entityManager)
-
-
Method Detail
-
checkForTransaction
public java.lang.Object checkForTransaction(boolean validateExistence)
INTERNAL: This method will be used to check for a transaction and throws exception if none exists. If this method returns without exception then a transaction exists. This method must be called before accessing the localUOW.- Specified by:
checkForTransactionin classTransactionWrapperImpl
-
clear
public void clear()
INTERNAL: Internal clear the underlying data structures that this transaction owns.- Overrides:
clearin classTransactionWrapperImpl
-
getTransaction
public javax.persistence.EntityTransaction getTransaction()
An ENtityTransaction cannot be used at the same time as a JTA transaction throw an exception- Specified by:
getTransactionin interfaceTransactionWrapper
-
setRollbackOnlyInternal
public void setRollbackOnlyInternal()
INTERNAL: Mark the current transaction so that the only possible outcome of the transaction is for the transaction to be rolled back. This is an internal method and if the txn is not active will do nothing- Specified by:
setRollbackOnlyInternalin classTransactionWrapperImpl
-
throwUserTransactionException
protected void throwUserTransactionException()
-
throwCheckTransactionFailedException
protected void throwCheckTransactionFailedException()
-
isJoinedToTransaction
public boolean isJoinedToTransaction(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
- Specified by:
isJoinedToTransactionin classTransactionWrapperImpl
-
registerIfRequired
public void registerIfRequired(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
- Specified by:
registerIfRequiredin classTransactionWrapperImpl
-
-