calling closedconnection.close() should not throw exception.

pull/454/head
Nitin 9 years ago
parent 514d062853
commit 4f467b3d37

@ -413,9 +413,9 @@ public class HikariPool extends PoolBase implements HikariPoolMXBean, IBagStateL
*/
final void closeConnection(final PoolEntry poolEntry, final String closureReason)
{
final Connection connection = poolEntry.connection;
poolEntry.close();
if (connectionBag.remove(poolEntry)) {
final Connection connection = poolEntry.connection;
poolEntry.close();
final int tc = totalConnections.decrementAndGet();
if (tc < 0) {
LOGGER.warn("{} - Internal accounting inconsistency, totalConnections={}", poolName, tc, new Exception());

@ -455,11 +455,14 @@ public abstract class ProxyConnection implements Connection
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
{
final String methodName = method.getName();
if ("abort".equals(methodName)) {
if ("isValid".equals(methodName)) {
return Boolean.FALSE;
}
else if ("close".equals(methodName)) {
return Void.TYPE;
}
else if ("isValid".equals(methodName)) {
return Boolean.FALSE;
else if ("abort".equals(methodName)) {
return Void.TYPE;
}
else if ("toString".equals(methodName)) {
return ClosedConnection.class.getCanonicalName();

Loading…
Cancel
Save