if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( "ConnectionPool: connection is fine, keeping it in pool: " + pc); putInPool ( pc ); putInPool ( newConn ); LOGGER .logDebug ( "ConnectionPool: replacing invalidated connection " PooledConnection newConn = source_ .getPooledConnection (); putInPool ( newConn ); LOGGER .logDebug ( "ConnectionPool: connection invalid, replacing it: "
/** * Puts back a connection after usage. This method should be called by * DataSource objects. * * @param conn * The connection. If the connection has been invalidated, or if * the pool is large enough, then this method will actually close * the connection. */ public synchronized void putBack ( XPooledConnection conn ) { if ( !conn.getInvalidated () && getSize () < maxSize_ ) { if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( "Putting connection back in pool: " + conn.toString () ); putInPool ( conn ); } else { try { if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( "Pool: closing connection: " + conn.toString () ); conn.close (); // closes underlying connection } catch ( SQLException err ) { } } }