*/
public synchronized void connectionClosed ( ConnectionEvent event )
{
// called when the Pooled Connection is resubmitted to the pool
// remove ThreadLocal mapping
XPooledConnection source = (XPooledConnection) event.getSource ();
Set values = previousConnections.entrySet ();
Iterator it = values.iterator ();
while ( it.hasNext () ) {
Map.Entry entry = (Map.Entry) it.next ();
Connection c = (Connection) entry.getValue ();
ThreadLocalConnection tlc = (ThreadLocalConnection) Proxy
.getInvocationHandler ( c );
if ( tlc.usesConnection ( source ) ) {
it.remove ();
}
}
source.removeConnectionEventListener ( this );
pool.putBack ( source );
}