Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added cleanup task to start of every execute. #2272

Merged
merged 10 commits into from
Jan 17, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ public java.sql.ResultSet executeQuery() throws SQLServerException, SQLTimeoutEx
loggerExternal.finer(toString() + ACTIVITY_ID + ActivityCorrelator.getCurrent().toString());
}
checkClosed();
connection.unprepareUnreferencedPreparedStatementHandles(false);
executeStatement(new PrepStmtExecCmd(this, EXECUTE_QUERY));
loggerExternal.exiting(getClassNameLogging(), "executeQuery");
return resultSet;
Expand All @@ -501,6 +502,7 @@ public java.sql.ResultSet executeQuery() throws SQLServerException, SQLTimeoutEx
*/
final java.sql.ResultSet executeQueryInternal() throws SQLServerException, SQLTimeoutException {
checkClosed();
connection.unprepareUnreferencedPreparedStatementHandles(false);
executeStatement(new PrepStmtExecCmd(this, EXECUTE_QUERY_INTERNAL));
return resultSet;
}
Expand All @@ -513,7 +515,7 @@ public int executeUpdate() throws SQLServerException, SQLTimeoutException {
}

checkClosed();

connection.unprepareUnreferencedPreparedStatementHandles(false);
executeStatement(new PrepStmtExecCmd(this, EXECUTE_UPDATE));

// this shouldn't happen, caller probably meant to call executeLargeUpdate
Expand All @@ -534,6 +536,7 @@ public long executeLargeUpdate() throws SQLServerException, SQLTimeoutException
loggerExternal.finer(toString() + ACTIVITY_ID + ActivityCorrelator.getCurrent().toString());
}
checkClosed();
connection.unprepareUnreferencedPreparedStatementHandles(false);
executeStatement(new PrepStmtExecCmd(this, EXECUTE_UPDATE));
loggerExternal.exiting(getClassNameLogging(), "executeLargeUpdate", updateCount);
return updateCount;
Expand All @@ -546,6 +549,7 @@ public boolean execute() throws SQLServerException, SQLTimeoutException {
loggerExternal.finer(toString() + ACTIVITY_ID + ActivityCorrelator.getCurrent().toString());
}
checkClosed();
connection.unprepareUnreferencedPreparedStatementHandles(false);
executeStatement(new PrepStmtExecCmd(this, EXECUTE));
loggerExternal.exiting(getClassNameLogging(), "execute", null != resultSet);
return null != resultSet;
Expand Down Expand Up @@ -2199,6 +2203,7 @@ public int[] executeBatch() throws SQLServerException, BatchUpdateException, SQL
loggerExternal.finer(toString() + ACTIVITY_ID + ActivityCorrelator.getCurrent().toString());
}
checkClosed();
connection.unprepareUnreferencedPreparedStatementHandles(false);
Jeffery-Wasty marked this conversation as resolved.
Show resolved Hide resolved
discardLastExecutionResults();

try {
Expand Down Expand Up @@ -2382,6 +2387,7 @@ public long[] executeLargeBatch() throws SQLServerException, BatchUpdateExceptio
loggerExternal.finer(toString() + ACTIVITY_ID + ActivityCorrelator.getCurrent().toString());
}
checkClosed();
connection.unprepareUnreferencedPreparedStatementHandles(false);
discardLastExecutionResults();

try {
Expand Down