#7201 try to call released() and removed() listeners when the connection pool gets closed

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2022-01-14 16:59:58 +01:00
parent 902b85b479
commit fdeb03d556
2 changed files with 9 additions and 1 deletions

View File

@ -459,6 +459,14 @@ public abstract class AbstractConnectionPool extends ContainerLifeCycle implemen
@Override
public void close()
{
// Manually release and remove entries to do our best effort calling the listeners.
for (Pool<Connection>.Entry entry : pool.values())
{
if (entry.release())
released(entry.getPooled());
if (entry.remove())
removed(entry.getPooled());
}
pool.close();
}

View File

@ -42,8 +42,8 @@ public class LeakTrackingConnectionPool extends DuplexConnectionPool
@Override
public void close()
{
LifeCycle.stop(this);
super.close();
LifeCycle.stop(this);
}
@Override