* method came from a PooledConnection, and the user calls the close()
* method of this connection object. What we need to do here is to
* release this PooledConnection from our pool...
*/
public void connectionClosed(ConnectionEvent event) {
PooledConnection pc = (PooledConnection)event.getSource();
// if this event occurred because we were validating, or if this
// connection has been marked for removal, ignore it
// otherwise return the connection to the pool.
if (!validatingMap.containsKey(pc)) {
PooledConnectionAndInfo info =
(PooledConnectionAndInfo) pcMap.get(pc);
if (info == null) {
throw new IllegalStateException(NO_KEY_MESSAGE);
}
try {
_pool.returnObject(info.getUserPassKey(), info);
} catch (Exception e) {
System.err.println("CLOSING DOWN CONNECTION AS IT COULD " +
"NOT BE RETURNED TO THE POOL");
pc.removeConnectionEventListener(this);
try {
_pool.invalidateObject(info.getUserPassKey(), info);
} catch (Exception e3) {
System.err.println("EXCEPTION WHILE DESTROYING OBJECT " +
info);