keeping connectionBag.remove and totalConnections.decrementAndGet()

close by
pull/539/head
Nitin 9 years ago
parent 5f851a4cfb
commit 87757fcd0a

@ -403,13 +403,12 @@ public class HikariPool extends PoolBase implements HikariPoolMXBean, IBagStateL
final void closeConnection(final PoolEntry poolEntry, final String closureReason) final void closeConnection(final PoolEntry poolEntry, final String closureReason)
{ {
if (connectionBag.remove(poolEntry)) { if (connectionBag.remove(poolEntry)) {
final Connection connection = poolEntry.connection;
poolEntry.close();
final int tc = totalConnections.decrementAndGet(); final int tc = totalConnections.decrementAndGet();
if (tc < 0) { if (tc < 0) {
LOGGER.warn("{} - Internal accounting inconsistency, totalConnections={}", poolName, tc, new Exception()); LOGGER.warn("{} - Internal accounting inconsistency, totalConnections={}", poolName, tc, new Exception());
} }
final Connection connection = poolEntry.connection;
poolEntry.close();
closeConnectionExecutor.execute(new Runnable() { closeConnectionExecutor.execute(new Runnable() {
@Override @Override
public void run() { public void run() {

Loading…
Cancel
Save