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

Connection.supportsTransactions (still or again?) broken for Azure Synapse "serverless" #2226

Closed
ravenAtSafe opened this issue Sep 29, 2023 · 1 comment · Fixed by #2227
Closed
Milestone

Comments

@ravenAtSafe
Copy link

Driver version

12.4.1

SQL Server version

Microsoft SQL Azure (RTM) - 12.0.2000.8
Aug 29 2023 01:39:41
Copyright (C) 2022 Microsoft Corporation

Client Operating System

Linux, Windows

JAVA/JVM version

Java 17

Table schema

n/a

Problem description

Problem 1
The first time you call supportsTransaction() against Azure Synapse "serverless" an exception with the text '@@TRANCOUNT' is not supported. is leaked out. While the driver is clearly trying to eat that exact exception it appears there is a leading space in the actual exception text that is messing everything up.

Problem 2
The second time you call supportsTransaction() it simply returns true because the first exception exercised a caching bug - when the exception is rethrown the supportsTransactions bool should be set back to null instead of being left as true.

Error message/stack trace

com.microsoft.sqlserver.jdbc.SQLServerException:  '@@TRANCOUNT' is not supported.
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:259)
	at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:304)
	at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:137)
	at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:42)
	at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:31)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection$1ConnectionCommand.doExecute(SQLServerConnection.java:4260)
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7675)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:4137)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectionCommand(SQLServerConnection.java:4268)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.supportsTransactions(SQLServerConnection.java:8105)
	at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.supportsTransactions(SQLServerDatabaseMetaData.java:2190)
	at COM.safe.fme.jdbc.JdbcCommon.commitIfSupported(JdbcCommon.java:807)
	at COM.safe.fme.jdbc.JdbcReader.close(JdbcReader.java:434)
com.microsoft.sqlserver.jdbc.SQLServerException:  '@@TRANCOUNT' is not supported.

Other

This is a followup to #2071 and https://github.com/microsoft/mssql-jdbc/pull/2075/files

@Jeffery-Wasty
Copy link
Contributor

We'll take another look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed Issues
3 participants