if connection is marked for eviction, bypass reset state etc and close

it.
pull/389/head
Nitin 10 years ago
parent fb50c8108c
commit 19896c0619

@ -147,8 +147,9 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
return statement;
}
private final void closeOpenStatements()
private final boolean closeOpenStatements()
{
boolean success = true;
final int size = openStatements.size();
if (size > 0) {
for (int i = 0; i < size; i++) {
@ -160,11 +161,13 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
}
catch (SQLException e) {
checkException(e);
success = success ? !poolEntry.evicted : false;
}
}
openStatements.clear();
}
return success;
}
// **********************************************************************
@ -179,8 +182,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
leakTask.cancel();
try {
closeOpenStatements();
if (closeOpenStatements()) {
if (isCommitStateDirty) {
lastAccess = clockSource.currentTime();
@ -197,6 +199,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
delegate.clearWarnings();
}
}
catch (SQLException e) {
// when connections are aborted, exceptions are often thrown that should not reach the application
if (!poolEntry.aborted) {

Loading…
Cancel
Save