Class PoolTxHelper


  • public class PoolTxHelper
    extends Object
    Transaction helper for the pool to check various states of a resource that is taking part in the transaction.
    Author:
    Jagadish Ramu
    • Field Detail

      • _logger

        protected static final Logger _logger
    • Constructor Detail

      • PoolTxHelper

        public PoolTxHelper​(PoolInfo poolInfo)
    • Method Detail

      • isLocalResourceEligibleForReuse

        public boolean isLocalResourceEligibleForReuse​(ResourceHandle h)
        Check whether the local resource can be put back to pool If true, unenlist the resource
        Parameters:
        h - ResourceHandle to be verified
        Returns:
        boolean
      • isLocalTransactionInProgress

        public boolean isLocalTransactionInProgress()
        Check whether a local transaction is in progress.
        Returns:
        true if a local transaction is in progress.
      • isLocalResourceInTransaction

        public boolean isLocalResourceInTransaction​(ResourceHandle h)
        Check whether the local resource in question is the one participating in transaction.
        Parameters:
        h - ResourceHandle
        Returns:
        true if the resource is participating in the transaction
      • isNonXAResource

        public boolean isNonXAResource​(ResourceHandle resource)
        Check whether the resource is non-xa
        Parameters:
        resource - Resource to be verified
        Returns:
        boolean indicating whether the resource is non-xa
      • isNonXAResourceAndFree

        public boolean isNonXAResourceAndFree​(JavaEETransaction tran,
                                              ResourceHandle resource)
        Check whether the resource is non-xa, free and is enlisted in transaction.
        Parameters:
        tran - Transaction
        resource - Resource to be verified
        Returns:
        boolean indicating whether the resource is free, non-xa and is enlisted in transaction
      • resourceEnlisted

        public void resourceEnlisted​(jakarta.transaction.Transaction tran,
                                     ResourceHandle resource)
        this method is called when a resource is enlisted in transation tran
        Parameters:
        tran - Transaction to which the resource need to be enlisted
        resource - Resource to be enlisted in the transaction
      • transactionCompleted

        public List<ResourceHandle> transactionCompleted​(jakarta.transaction.Transaction tran,
                                                         int status,
                                                         PoolInfo poolInfo)
        this method is called when transaction tran is completed
        Parameters:
        tran - transaction which has completed
        status - transaction status
        poolInfo - Pool name
        Returns:
        delisted resources