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

Non standard exception type is thrown when attempting to use an unsupported feature #2580

Open
jameswilliams1 opened this issue Jan 10, 2025 · 0 comments

Comments

@jameswilliams1
Copy link

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]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To be triaged
Development

No branches or pull requests

1 participant