Class EntityTransactionWrapper
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.transaction.TransactionWrapperImpl
-
- org.eclipse.persistence.internal.jpa.transaction.EntityTransactionWrapper
-
- All Implemented Interfaces:
TransactionWrapper
public class EntityTransactionWrapper extends TransactionWrapperImpl implements TransactionWrapper
INTERNAL: JDK 1.5 specific version of EntityTransactionWrapper. Differs from the JDK 1.4 version in that it implements a different version of the TransactionWrapper interface, uses a different EntityManager, and returns a different EntityTransaction version.- See Also:
EntityTransactionWrapper
-
-
Field Summary
Fields Modifier and Type Field Description protected EntityTransactionImplentityTransaction-
Fields inherited from class org.eclipse.persistence.internal.jpa.transaction.TransactionWrapperImpl
entityManager, localUOW, txnKey
-
-
Constructor Summary
Constructors Constructor Description EntityTransactionWrapper(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.EntityManagerImplgetEntityManager()javax.persistence.EntityTransactiongetTransaction()Lazy initialize the EntityTransaction.booleanisJoinedToTransaction(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)voidregisterIfRequired(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)voidsetRollbackOnlyInternal()Mark the current transaction so that the only possible outcome of the transaction is for the transaction to be rolled back.protected voidthrowCheckTransactionFailedException()-
Methods inherited from class org.eclipse.persistence.internal.jpa.transaction.TransactionWrapperImpl
clear, getLocalUnitOfWork, setLocalUnitOfWork
-
-
-
-
Field Detail
-
entityTransaction
protected EntityTransactionImpl entityTransaction
-
-
Constructor Detail
-
EntityTransactionWrapper
public EntityTransactionWrapper(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
-
getEntityManager
public EntityManagerImpl getEntityManager()
-
getTransaction
public javax.persistence.EntityTransaction getTransaction()
Lazy initialize the EntityTransaction. There can only be one EntityTransaction at a time.- Specified by:
getTransactionin interfaceTransactionWrapper
-
isJoinedToTransaction
public boolean isJoinedToTransaction(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
- Specified by:
isJoinedToTransactionin classTransactionWrapperImpl
-
setRollbackOnlyInternal
public void setRollbackOnlyInternal()
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
-
throwCheckTransactionFailedException
protected void throwCheckTransactionFailedException()
-
registerIfRequired
public void registerIfRequired(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
- Specified by:
registerIfRequiredin classTransactionWrapperImpl
-
-