#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:
parent
902b85b479
commit
fdeb03d556
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@ public class LeakTrackingConnectionPool extends DuplexConnectionPool
|
|||
@Override
|
||||
public void close()
|
||||
{
|
||||
LifeCycle.stop(this);
|
||||
super.close();
|
||||
LifeCycle.stop(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue