Driver version
12.8.1.jre11
SQL Server version
Microsoft SQL Server 2019 (RTM-CU25) (KB5033688) - 15.0.4355.3 (X64)
Jan 30 2024 17:02:22
Copyright (C) 2019 Microsoft Corporation
Developer Edition (64-bit) on Linux (Red Hat Enterprise Linux)
Client Operating System
Linux
JAVA/JVM version
Java 21 LTS
Problem description
After upgrading to Spring boot 3.4 I have noticed that a non-standard exception type is thrown when an unsupported operation is attempted (in this case explicitly releasing a savepoint), which causes our application to fail as most third party libraries will expect a SQLFeatureNotSupportedException in this case rather than a SQL Server specific error.
See the issue raised with Spring for reference
Expected behavior
java.sql.SQLFeatureNotSupportedException is thrown when there is an attempt to manually release a transaction savepoint
Actual behavior
com.microsoft.sqlserver.jdbc.SQLServerException is thrown
Error message/stack trace
2025-01-10 01:01:13,380 DEBUG [tomcat-handler-493] o.s.jdbc.support.JdbcTransactionManager - Releasing transaction savepoint
2025-01-10 01:01:13,381 DEBUG [tomcat-handler-493] c.m.s.jdbc.internals.SQLServerException - *** SQLException: com.microsoft.sqlserver.jdbc.SQLServerException: This operation is not supported. This operation is not supported.
2025-01-10 01:01:13,381 DEBUG [tomcat-handler-493] o.s.jdbc.support.JdbcTransactionManager - Initiating transaction rollback
2025-01-10 01:01:13,381 DEBUG [tomcat-handler-493] o.s.jdbc.support.JdbcTransactionManager - Rolling back JDBC transaction on Connection [HikariProxyConnection@107047065 wrapping ConnectionID:1 ClientConnectionId: c741adb7-2049-48ae-ada2-37974c7dc396]
Driver version
12.8.1.jre11
SQL Server version
Microsoft SQL Server 2019 (RTM-CU25) (KB5033688) - 15.0.4355.3 (X64)
Jan 30 2024 17:02:22
Copyright (C) 2019 Microsoft Corporation
Developer Edition (64-bit) on Linux (Red Hat Enterprise Linux)
Client Operating System
Linux
JAVA/JVM version
Java 21 LTS
Problem description
After upgrading to Spring boot 3.4 I have noticed that a non-standard exception type is thrown when an unsupported operation is attempted (in this case explicitly releasing a savepoint), which causes our application to fail as most third party libraries will expect a
SQLFeatureNotSupportedExceptionin this case rather than a SQL Server specific error.See the issue raised with Spring for reference
Expected behavior
java.sql.SQLFeatureNotSupportedExceptionis thrown when there is an attempt to manually release a transaction savepointActual behavior
com.microsoft.sqlserver.jdbc.SQLServerExceptionis thrownError message/stack trace