Fixed
-
Fix getIndexInfo internal prepared statement leak #3097
- What was fixed:
DatabaseMetaData.getIndexInfo()closed the internal prepared statement it uses to query index metadata, instead of leaving it open. - Who benefits: Applications that call
getIndexInfo()repeatedly on long-lived connections. - Impact: Prevents accumulation of unclosed internal statements and their server resources.
- What was fixed:
-
Fix direct batch update counts and batch exception type #3102
- What was fixed:
executeBatch()andexecuteLargeBatch()withprepareMethod=none, and the direct path ofscopeTempTablesToConnection, reported1for every successful entry. They now return the server's update count, including0and multi-row counts. Entries without a count are reported asSUCCESS_NO_INFO, and entries that did not run asEXECUTE_FAILED. Failures throwBatchUpdateExceptionwith these counts instead of a wrappedSQLServerException. - Who benefits: Applications using
prepareMethod=nonebatches whose statements affect zero or multiple rows, including optimistic-locking checks. - Impact: Counts are correct when each batch entry is a single DML statement. For conditional or multi-statement entries, counts are assigned in the order the server returns results, not per entry. Use
prepareMethod=prepexecwhere per-entry counts are required.
- What was fixed:
-
Fix missed SQL errors and premature result processing in direct prepared-statement batches #3114
- What was fixed: Direct batches now read the server response to the end. Conditional statements such as
IFno longer cause executed entries to be reported asEXECUTE_FAILED, and errors later in the batch are reported throughBatchUpdateException. A result set returned by a batch entry is rejected withBatchUpdateException. It no longer closes the connection, and errors in its rows are reported. - Who benefits: Applications using
prepareMethod=nonebatches with conditional logic, multiple statements, orSELECTstatements in batch entries. - Impact: Prevents a failed batch from being reported as successful. A batch entry that returns rows now fails with
BatchUpdateException, as the JDBC specification requires.
- What was fixed: Direct batches now read the server response to the end. Conditional statements such as