Interface TransactionIntegration


  • public interface TransactionIntegration
    Agroal provides an integration point for transaction systems to modify the behaviour of the pool. The transaction layer can control the lifecycle of connections and define what connections are acquired and when these return to the pool. It is responsible for commit or rollback of the database transaction.
    Author:
    Luis Barreiro
    • Method Detail

      • none

        static TransactionIntegration none()
        The default implementation of the transaction layer, that performs no actions.
      • getTransactionAware

        TransactionAware getTransactionAware()
                                      throws SQLException
        Agroal inquires the transaction layer for a Tx aware resource (a connection) that can be acquired. Usually, if there is a resource already associated with the calling thread it is returned.
        Throws:
        SQLException
      • associate

        void associate​(TransactionAware transactionAware,
                       XAResource xaResource)
                throws SQLException
        Agroal notifies the transaction layer a Tx aware resource (a connection) and it's corresponding XA resource were acquired. Usually, the resource is associated with the calling thread.
        Throws:
        SQLException
      • disassociate

        boolean disassociate​(TransactionAware transactionAware)
                      throws SQLException
        Agroal notifies the transaction layer that a Tx aware resource (a connection) is about to be returned to the pool. Usually, the resource is disassociated from the calling thread and returned to the pool.
        Returns:
        true if the Tx aware should return to the pool, false if it should not.
        Throws:
        SQLException