Skip to content

Batched CallableStatement timeout handling#1960

Closed
mmimica wants to merge 5 commits intomicrosoft:mainfrom
mmimica:testBatchedSpCallTimeout
Closed

Batched CallableStatement timeout handling#1960
mmimica wants to merge 5 commits intomicrosoft:mainfrom
mmimica:testBatchedSpCallTimeout

Conversation

@mmimica
Copy link
Copy Markdown
Contributor

@mmimica mmimica commented Nov 8, 2022

Driver version

11.2.1, main

Table schema

See com.microsoft.sqlserver.jdbc.unit.statement.BatchExecutionTest#testBatchedSpCallTimeout in the PR.

Problem description

With enablePrepareOnFirstPreparedStatementCall=true.
When timeout happens, the update count in the BatchUpdateException is incorrect and doesn't reflect what actually happened.

Expected behavior

In the test, 5 statements are executed in a batch. The 4th one statement times out. The first three succeed, the last two fail. updateCount should reflect that.

Actual behavior

updateCounts [1, -3, 1, -3, -3] - indicating that the second call failed, while it didn't. Either [1, 1, -3, -3, -3] or [1, 1, -1, -3, -3] would be acceptable.

Any other details that can be helpful

Only with enablePrepareOnFirstPreparedStatementCall=true.

ulvii and others added 5 commits December 3, 2020 12:37
Release | Merge dev to master for 9.1.1-preview release
# Conflicts:
#	CHANGELOG.md
#	README.md
#	azure-pipelines.yml
#	build.gradle
#	mssql-jdbc_auth_LICENSE
#	pom.xml
#	src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
#	src/main/java/com/microsoft/sqlserver/jdbc/SQLJdbcVersion.java
#	src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java
#	src/main/java/com/microsoft/sqlserver/jdbc/SQLServerMSAL4JUtils.java
#	src/samples/adaptive/pom.xml
#	src/samples/alwaysencrypted/pom.xml
#	src/samples/azureactivedirectoryauthentication/pom.xml
#	src/samples/connections/pom.xml
#	src/samples/constrained/pom.xml
#	src/samples/dataclassification/pom.xml
#	src/samples/datatypes/pom.xml
#	src/samples/resultsets/pom.xml
#	src/samples/sparse/pom.xml
#	src/test/java/com/microsoft/sqlserver/jdbc/TestResource.java
#	src/test/java/com/microsoft/sqlserver/jdbc/databasemetadata/DatabaseMetaDataTest.java
#	src/test/java/com/microsoft/sqlserver/jdbc/fedauth/ErrorMessageTest.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants