Interface JavaEETransactionManagerDelegate

    • Method Detail

      • useLAO

        boolean useLAO()
        Returns true if this implementation supports last agent optimization.
      • setUseLAO

        void setUseLAO​(boolean b)
        Reset LAO value.
        Parameters:
        b - the boolean value for the LAO flag.
      • commitDistributedTransaction

        void commitDistributedTransaction()
                                   throws jakarta.transaction.RollbackException,
                                          jakarta.transaction.HeuristicMixedException,
                                          jakarta.transaction.HeuristicRollbackException,
                                          SecurityException,
                                          IllegalStateException,
                                          jakarta.transaction.SystemException
        Commit distributed transaction if there is any.
        Throws:
        jakarta.transaction.RollbackException
        jakarta.transaction.HeuristicMixedException
        jakarta.transaction.HeuristicRollbackException
        SecurityException
        IllegalStateException
        jakarta.transaction.SystemException
      • getStatus

        int getStatus()
               throws jakarta.transaction.SystemException
        Get implementation specific status of the transaction associated with the current thread.
        Returns:
        the status value as an int.
        Throws:
        jakarta.transaction.SystemException
      • getTransaction

        jakarta.transaction.Transaction getTransaction()
                                                throws jakarta.transaction.SystemException
        Get implementation specific transaction object that represents the transaction context of the calling thread.
        Returns:
        the transaction object.
        Throws:
        jakarta.transaction.SystemException
      • getJavaEETransaction

        JavaEETransaction getJavaEETransaction​(jakarta.transaction.Transaction t)
        Get local transaction object that corresponds to this transaction instance.
        Returns:
        the transaction object.
      • enlistDistributedNonXAResource

        boolean enlistDistributedNonXAResource​(jakarta.transaction.Transaction tran,
                                               TransactionalResource h)
                                        throws jakarta.transaction.RollbackException,
                                               IllegalStateException,
                                               jakarta.transaction.SystemException
        Perform implementation specific steps to enlist a non-XA resource with a distribute transaction.
        Parameters:
        tran - the Transaction object to be used to enlist the resource.
        h - the TransactionalResource object to be enlisted.
        Returns:
        true if the resource was enlisted successfully.
        Throws:
        jakarta.transaction.RollbackException
        IllegalStateException
        jakarta.transaction.SystemException
      • enlistLAOResource

        boolean enlistLAOResource​(jakarta.transaction.Transaction tran,
                                  TransactionalResource h)
                           throws jakarta.transaction.RollbackException,
                                  IllegalStateException,
                                  jakarta.transaction.SystemException
        Perform implementation specific steps to enlist resource as a LAO.
        Parameters:
        tran - the Transaction object to be used to enlist the resource.
        h - the TransactionalResource object to be enlisted.
        Returns:
        true if the resource was enlisted successfully.
        Throws:
        jakarta.transaction.RollbackException
        IllegalStateException
        jakarta.transaction.SystemException
      • setRollbackOnlyDistributedTransaction

        void setRollbackOnlyDistributedTransaction()
                                            throws IllegalStateException,
                                                   jakarta.transaction.SystemException
        Perform implementation specific steps to set setRollbackOnly status for distributed transaction if there is any.
        Throws:
        IllegalStateException
        jakarta.transaction.SystemException
      • suspend

        jakarta.transaction.Transaction suspend​(JavaEETransaction tx)
                                         throws jakarta.transaction.SystemException
        Perform implementation specific steps to suspend a JavaEETransaction.
        Parameters:
        tx - the JavaEETransaction object to be suspend.
        Returns:
        Transaction object representing the suspended transaction.
        Throws:
        jakarta.transaction.SystemException
      • resume

        void resume​(jakarta.transaction.Transaction tx)
             throws jakarta.transaction.InvalidTransactionException,
                    IllegalStateException,
                    jakarta.transaction.SystemException
        Perform implementation specific steps to resume a Transaction.
        Parameters:
        tx - the Transaction object that represents the transaction to be resumed.
        Throws:
        jakarta.transaction.InvalidTransactionException
        IllegalStateException
        jakarta.transaction.SystemException
      • removeTransaction

        void removeTransaction​(jakarta.transaction.Transaction tx)
        Remove the Transaction object from the cache.
        Parameters:
        tx - the Transaction object to be removed.
      • getOrder

        int getOrder()
        The delegate with the largest order will be used.
        Returns:
        the order in which this delegate should be used.
      • setTransactionManager

        void setTransactionManager​(JavaEETransactionManager tm)
        Set the JavaEETransactionManager reference.
        Parameters:
        tm - the JavaEETransactionManager object.
      • supportsXAResource

        boolean supportsXAResource()
        Returns true if this delegate supports XA resources.
      • startJTSTx

        TransactionInternal startJTSTx​(JavaEETransaction t,
                                       boolean isAssociatedTimeout)
                                throws jakarta.transaction.RollbackException,
                                       IllegalStateException,
                                       jakarta.transaction.SystemException
        Start new JTS transaction for the existing local transaction object.
        Parameters:
        t - the JavaEETransaction object.
        isAssociatedTimeout - true if transaction has a timeout associated with it.
        Returns:
        the new JTS Transaction instance.
        Throws:
        jakarta.transaction.RollbackException
        IllegalStateException
        jakarta.transaction.SystemException
      • recover

        void recover​(XAResource[] resourceList)
        Recover an array of XAResource objects for a failed XA transaction.
        Parameters:
        resourceList - the array of XAResource objects to recover.
        Throws:
        UnsupportedOperationException - if a delegate doesn't support this functionality.
      • initRecovery

        void initRecovery​(boolean force)
        Initialize recovery framework. Is a no-op if a delegate doesn't support this functionality.
      • getXATerminator

        jakarta.resource.spi.XATerminator getXATerminator()
        This is used by importing transactions via the Connector contract. Should not be called
        Returns:
        a XATerminator instance.
        Throws:
        UnsupportedOperationException - if a delegate doesn't support this functionality.
      • release

        void release​(Xid xid)
              throws jakarta.resource.spi.work.WorkException
        Release a transaction. This call causes the calling thread to be dissociated from the specified transaction.

        This is used by importing transactions via the Connector contract.

        Parameters:
        xid - the Xid object representing a transaction.
        Throws:
        UnsupportedOperationException - if a delegate doesn't support this functionality.
        jakarta.resource.spi.work.WorkException
      • recreate

        void recreate​(Xid xid,
                      long timeout)
               throws jakarta.resource.spi.work.WorkException
        Recreate a transaction based on the Xid. This call causes the calling thread to be associated with the specified transaction.

        This is used by importing transactions via the Connector contract.

        Parameters:
        xid - the Xid object representing a transaction.
        timeout - the timeout for the transaction to be recreated.
        Throws:
        UnsupportedOperationException - if a delegate doesn't support this functionality.
        jakarta.resource.spi.work.WorkException
      • getXAResourceWrapper

        XAResourceWrapper getXAResourceWrapper​(String clName)
        Returns an instance of an XAResourceWrapper if this delegate supports transaction recovery and there is a wrapper available for this class name. Returns null otherwise.
        Returns:
        an instance of an XAResourceWrapper or null if this delegate doesn't support transaction recovery or a wrapper is not available.
      • handlePropertyUpdate

        void handlePropertyUpdate​(String name,
                                  Object value)
        Handle configuration change.
        Parameters:
        name - the name of the configuration property.
        value - the ne value of the configuration.
      • recoverIncompleteTx

        boolean recoverIncompleteTx​(boolean delegated,
                                    String logPath,
                                    XAResource[] xaresArray)
                             throws Exception
        Recover the populated array of XAResource if this delegate supports transaction recovery.
        Parameters:
        delegated - true if the recovery process is owned by this instance.
        logPath - the name of the transaction logging directory
        xaresArray - the array of XA Resources to be recovered.
        Returns:
        true if the recovery has been successful.
        Throws:
        Exception
      • getReadLock

        Lock getReadLock()
        Return the delegate specific read lock that implements Lock interface.
      • isWriteLocked

        boolean isWriteLocked()
        Return true if the delegate had its write lock acquired.
      • acquireWriteLock

        void acquireWriteLock()
        Allows the delegate to acquire a write lock.
      • releaseWriteLock

        void releaseWriteLock()
        Allows the delegate to release a write lock.
      • isNullTransaction

        boolean isNullTransaction()
        Return the delegate specific implementation when a "null transaction context" was received from the client. See EJB2.0 spec section 19.6.2.1. A null tx context has no Coordinator objref. It indicates that the client had an active tx but the client container did not support tx interop.
      • getTransactionAdminBean

        TransactionAdminBean getTransactionAdminBean​(jakarta.transaction.Transaction t)
                                              throws jakarta.transaction.SystemException
        Return TransactionAdminBean with delegate specific implementation details of an active Transaction.
        Throws:
        jakarta.transaction.SystemException
      • getTxLogLocation

        String getTxLogLocation()
        Return location of transaction logs
        Returns:
        String location of transaction logs
      • registerRecoveryResourceHandler

        void registerRecoveryResourceHandler​(XAResource xaResource)
        Allows an arbitrary XAResource to register for recovery
        Parameters:
        xaResource - XAResource to register for recovery