Fixed #361 Merge branch '2.3.x' into dev

pull/372/head
Brett Wooldridge 10 years ago
commit a31c2df6b7

@ -147,22 +147,16 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
return statement; return statement;
} }
// ********************************************************************** private final void closeOpenStatements()
// "Overridden" java.sql.Connection Methods
// **********************************************************************
/** {@inheritDoc} */
@Override
public final void close() throws SQLException
{ {
if (delegate != ClosedConnection.CLOSED_CONNECTION) {
leakTask.cancel();
final int size = openStatements.size(); final int size = openStatements.size();
if (size > 0) { if (size > 0) {
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
try { try {
openStatements.get(i).close(); final Statement statement = openStatements.get(i);
if (statement != null) {
statement.close();
}
} }
catch (SQLException e) { catch (SQLException e) {
checkException(e); checkException(e);
@ -171,8 +165,22 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy
openStatements.clear(); openStatements.clear();
} }
}
// **********************************************************************
// "Overridden" java.sql.Connection Methods
// **********************************************************************
/** {@inheritDoc} */
@Override
public final void close() throws SQLException
{
if (delegate != ClosedConnection.CLOSED_CONNECTION) {
leakTask.cancel();
try { try {
closeOpenStatements();
if (isCommitStateDirty) { if (isCommitStateDirty) {
lastAccess = clockSource.currentTime(); lastAccess = clockSource.currentTime();

Loading…
Cancel
Save