/** * @see javax.sql.ConnectionEventListener#connectionClosed(javax.sql.ConnectionEvent) */ 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 ); }
/** * @see javax.sql.ConnectionEventListener#connectionClosed(javax.sql.ConnectionEvent) */ public void connectionClosed ( ConnectionEvent arg ) { DTPPooledConnection pc = (DTPPooledConnection) arg.getSource (); if ( pc.isDiscarded () ) { pc.removeConnectionEventListener ( this ); pool_.putBack ( pc ); } }