private void release ( PooledConnection < C > pooledConnection ) { long currentTime = System . currentTimeMillis ( ) ; long useTime ; synchronized ( pooledConnection ) { pooledConnection . releaseTime = currentTime ; useTime = currentTime - pooledConnection . startTime ; if ( useTime > 0 ) pooledConnection . totalTime . addAndGet ( useTime ) ; pooledConnection . allocateStackTrace = null ; } // Remove from the pool synchronized ( poolLock ) { try { if ( busyConnections . remove ( pooledConnection ) ) availableConnections . add ( pooledConnection ) ; } finally { poolLock . notify ( ) ; } } }
Releases a PooledConnection . It is safe to release it multiple times . The connection should have either been closed or reset before this is called because this makes the connection available for the next request .