Module org.eclipse.persistence.jpa
Class JTATransactionWrapper
java.lang.Object
org.eclipse.persistence.internal.jpa.transaction.TransactionWrapperImpl
org.eclipse.persistence.internal.jpa.transaction.JTATransactionWrapper
- All Implemented Interfaces:
TransactionWrapper
INTERNAL:
JTA transaction wrapper.
Allows the EntityManager to transparently use JTA vs local transactions.
-
Field Summary
Fields inherited from class org.eclipse.persistence.internal.jpa.transaction.TransactionWrapperImpl
entityManager, localUOW, txnKey
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncheckForTransaction
(boolean validateExistence) INTERNAL: This method will be used to check for a transaction and throws exception if none exists.void
clear()
INTERNAL: Internal clear the underlying data structures that this transaction owns.An ENtityTransaction cannot be used at the same time as a JTA transaction throw an exceptionboolean
void
void
INTERNAL: Mark the current transaction so that the only possible outcome of the transaction is for the transaction to be rolled back.protected void
protected void
Methods inherited from class org.eclipse.persistence.internal.jpa.transaction.TransactionWrapperImpl
getLocalUnitOfWork, setLocalUnitOfWork
-
Field Details
-
txnController
-
-
Constructor Details
-
JTATransactionWrapper
-
-
Method Details
-
checkForTransaction
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:
checkForTransaction
in classTransactionWrapperImpl
-
clear
public void clear()INTERNAL: Internal clear the underlying data structures that this transaction owns.- Overrides:
clear
in classTransactionWrapperImpl
-
getTransaction
An ENtityTransaction cannot be used at the same time as a JTA transaction throw an exception- Specified by:
getTransaction
in 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:
setRollbackOnlyInternal
in classTransactionWrapperImpl
-
throwUserTransactionException
protected void throwUserTransactionException() -
throwCheckTransactionFailedException
protected void throwCheckTransactionFailedException() -
isJoinedToTransaction
- Specified by:
isJoinedToTransaction
in classTransactionWrapperImpl
-
registerIfRequired
- Specified by:
registerIfRequired
in classTransactionWrapperImpl
-