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

issue#2537 - Fix for SQLServerConnection infinite loop #2547

Merged
merged 3 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7598,7 +7598,7 @@
}

/** request started flag */
private boolean requestStarted = false;
private volatile boolean requestStarted = false;

/** original database autocommit mode */
private boolean originalDatabaseAutoCommitMode;
Expand Down Expand Up @@ -7740,9 +7740,13 @@
sqlWarnings = originalSqlWarnings;
if (null != openStatements) {
while (!openStatements.isEmpty()) {
try (Statement st = openStatements.get(0)) {}
Statement st = openStatements.get(0);

Check warning on line 7743 in src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java#L7743

Added line #L7743 was not covered by tests
try {
st.close();

Check warning on line 7745 in src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java#L7745

Added line #L7745 was not covered by tests
} finally {
removeOpenStatement((SQLServerStatement) st);

Check warning on line 7747 in src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java#L7747

Added line #L7747 was not covered by tests
}
}
openStatements.clear();
}
requestStarted = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ boolean onDone(TDSReader tdsReader) throws SQLServerException {
/**
* True is the statement is closed
*/
boolean bIsClosed;
volatile boolean bIsClosed;

/**
* True if the user requested to driver to generate insert keys
Expand Down