Restore max lifetime check to getConnection() rather than only in the

housekeeper thread.  An extremely active pool may never find an idle
connection in the housekeeper alone.
pull/60/head
Brett Wooldridge 11 years ago
parent f059d39aa6
commit b626016544

@ -154,7 +154,7 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener
connection.unclose();
final long now = System.currentTimeMillis();
if ((now - connection.getCreationTime() > maxLife) || (now - connection.getLastAccess() > 1000 && !isConnectionAlive(connection, timeout)))
if ((maxLife > 0 && now - connection.getCreationTime() > maxLife) || (now - connection.getLastAccess() > 1000 && !isConnectionAlive(connection, timeout)))
{
closeConnection(connection); // Throw away the dead connection, try again
timeout -= (System.currentTimeMillis() - start);

Loading…
Cancel
Save