* @param cl connection listener that wraps connection
* @param kill kill connection or not
*/
public void returnManagedConnection(ConnectionListener cl, boolean kill)
{
Pool localStrategy = cl.getPool();
if (localStrategy != pool)
{
kill = true;
}
try
{
if (!kill && cl.getState().equals(ConnectionState.NORMAL))
{
cl.tidyup();
}
}
catch (Throwable t)
{
log.warn("Error during tidy up connection" + cl, t);
kill = true;
}
try
{
localStrategy.returnConnection(cl, kill);
}
catch (ResourceException re)
{
// We can receive notification of an error on the connection
// before it has been assigned to the pool. Reduce the noise for