Package io.agroal.api.transaction
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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThis interface is implemented by the connection factory so that it can provide recovery resources to the transaction layer. -
Method Summary
Modifier and TypeMethodDescriptionvoidAgroal calls this method on init to register itself as a XA module capable of recovery.voidassociate(TransactionAware transactionAware, XAResource xaResource) Agroal notifies the transaction layer a Tx aware resource (a connection) and it's corresponding XA resource were acquired.booleandisassociate(TransactionAware transactionAware) Agroal notifies the transaction layer that a Tx aware resource (a connection) is about to be returned to the pool.Agroal inquires the transaction layer for a Tx aware resource (a connection) that can be acquired.static TransactionIntegrationnone()The default implementation of the transaction layer, that performs no actions.voidAgroal calls this method on shutdown to de-register itself as a XA module capable of recovery.
-
Method Details
-
none
The default implementation of the transaction layer, that performs no actions. -
getTransactionAware
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
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
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
-
addResourceRecoveryFactory
Agroal calls this method on init to register itself as a XA module capable of recovery. -
removeResourceRecoveryFactory
Agroal calls this method on shutdown to de-register itself as a XA module capable of recovery.
-