Luis Barreiro created AG-136:
--------------------------------
Summary: Add a safe callback interface for pool events
Key: AG-136
URL:
https://issues.redhat.com/browse/AG-136
Project: Agroal
Issue Type: Feature Request
Components: api, pool
Affects Versions: 1.7
Reporter: Luis Barreiro
Assignee: Luis Barreiro
Fix For: 1.8
There is a need for a callback to intercept pool events that is safe for applications to
use.
Right now the current listener interface is fine for container implementations, but should
not be used by higher level applications because:
* The ```AgroalDataSourceListener``` interface was not designed with the Interceptor
concept in mind. Agroal always invoke the listeners in the given order, so if there are 2
listeners with common concerns,only one of them will be effective.
* The Listener gives access to the raw ```java.sql.Connection`` and therefore any error
may cause chaos on the pool (leave an invalid connection on the pool, etc.)
* Some methods on the listener are invoked by Agroal's own thread and therefore should
not execute any long running task (that is not a problem in the context of this issue, but
may be if we expose this interface as API)
* When running Agroal with a TransactionManager, the life-cycle of the connections can be
slightly different as this is associated with the transaction. This does not map well on
the current listener interface.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)