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 Details

  • Constructor Details

    • JTATransactionWrapper

      public JTATransactionWrapper(EntityManagerImpl entityManager)
  • Method Details

    • checkForTransaction

      public 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:
      checkForTransaction in class TransactionWrapperImpl
    • clear

      public void clear()
      INTERNAL: Internal clear the underlying data structures that this transaction owns.
      Overrides:
      clear in class TransactionWrapperImpl
    • getTransaction

      public EntityTransaction getTransaction()
      An ENtityTransaction cannot be used at the same time as a JTA transaction throw an exception
      Specified by:
      getTransaction in interface TransactionWrapper
    • 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 class TransactionWrapperImpl
    • throwUserTransactionException

      protected void throwUserTransactionException()
    • throwCheckTransactionFailedException

      protected void throwCheckTransactionFailedException()
    • isJoinedToTransaction

      public boolean isJoinedToTransaction(UnitOfWorkImpl uow)
      Specified by:
      isJoinedToTransaction in class TransactionWrapperImpl
    • registerIfRequired

      public void registerIfRequired(UnitOfWorkImpl uow)
      Specified by:
      registerIfRequired in class TransactionWrapperImpl