Fix incorrect incrementation of totalConnections when there is a retry. It should only be incremented on the first time through the loop.

pull/42/head
Brett Wooldridge 11 years ago
parent 2112a3470e
commit d8bc281902

@ -340,7 +340,7 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener
try
{
// Speculative increment of totalConnections with expectation of success
if (totalConnections.incrementAndGet() > configuration.getMaximumPoolSize())
if (retries == 0 && totalConnections.incrementAndGet() > configuration.getMaximumPoolSize())
{
totalConnections.decrementAndGet();
break;

Loading…
Cancel
Save