*/
public void returnManagedConnection(org.jboss.jca.core.api.connectionmanager.listener.ConnectionListener bcl,
boolean kill)
{
// Hack - We know that we can type cast it
ConnectionListener cl = (ConnectionListener)bcl;
Pool localStrategy = cl.getPool();
if (localStrategy != pool || shutdown.get())
{
kill = true;
}
try
{
if (!kill && cl.getState().equals(ConnectionState.NORMAL))
{
cl.tidyup();
}
}
catch (Throwable t)
{
log.errorDuringTidyUpConnection(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
// these errors
if (kill)
{
log.debug("resourceException killing connection (error retrieving from pool?)", re);
}
else
{
log.resourceExceptionReturningConnection(cl.getManagedConnection(), re);
}
}
}