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 · 1 comment · May be fixed by #2583
Open

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

jameswilliams1 opened this issue Jan 10, 2025 · 1 comment · May be fixed by #2583
Assignees
Labels
Under Review Used for pull requests under review

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]
@github-project-automation github-project-automation bot moved this to To be triaged in MSSQL JDBC Jan 10, 2025
@machavan machavan self-assigned this Jan 13, 2025
@machavan machavan added the Under Investigation Used for issues under investigation label Jan 13, 2025
@machavan machavan moved this from To be triaged to Under Peer Review in MSSQL JDBC Jan 13, 2025
@machavan machavan linked a pull request Jan 13, 2025 that will close this issue
@machavan machavan added Under Review Used for pull requests under review and removed Under Investigation Used for issues under investigation labels Jan 13, 2025
@lilgreenbird
Copy link
Contributor

hi @jameswilliams1

Thanks for reporting this we have a fix for this in PR #2583 it is currently under review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Under Review Used for pull requests under review
Projects
Status: Under Peer Review
Development

Successfully merging a pull request may close this issue.

3 participants