microsoft / mssql-jdbc

The Microsoft JDBC Driver for SQL Server is a Type 4 JDBC driver that provides database connectivity with SQL Server through the standard JDBC application program interfaces (APIs).
MIT License
1.06k stars 427 forks source link

Changed driver behavior to allow prepared statement objects to be reused, preventing a "multiple queries are not allowed" error #2482

Closed tkyc closed 3 months ago

tkyc commented 4 months ago

Discovered that when attempting to reuse the same pstmt object, the driver would error out with R_multipleQueriesNotAllowed and consume that error.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 50.78%. Comparing base (0e97689) to head (ed981ca). Report is 4 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2482 +/- ## ============================================ - Coverage 50.78% 50.78% -0.01% + Complexity 3888 3887 -1 ============================================ Files 145 145 Lines 33481 33479 -2 Branches 5690 5689 -1 ============================================ - Hits 17004 17002 -2 Misses 14030 14030 Partials 2447 2447 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

tkyc commented 3 months ago

This error isn't explicitly thrown, so I can't really test by not looking for it. In the old code, this error was consumed and the driver would keep running.