if (activeConnectionCount.incrementAndGet() > config.getMaxConns()) {
activeConnectionCount.decrementAndGet();
try {
connection = idleConnections.poll(config.getMaxTimeoutWhenExhausted(), TimeUnit.MILLISECONDS);
if (connection == null) {
throw new PoolTimeoutException("Timed out waiting for connection from bag");
}
return connection;
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();