]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fix 'No transaction found' error on Synapse.
authorGord Thompson <gord@gordthompson.com>
Fri, 22 Jul 2022 12:31:24 +0000 (08:31 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 2 Aug 2022 17:59:16 +0000 (13:59 -0400)
commit5741068012ff60ccd0b2c2b3451eb923954cc195
tree699fe390a673d78c0839cdbcfc1fd78f2546f7b1
parent3ff18812d8d80b2016ceeea98c808a76cae85e48
Fix 'No transaction found' error on Synapse.

Fixed issue where the SQL Server dialect's query for the current isolation
level would fail on Azure Synapse Analytics, due to the way in which this
database handles transaction rollbacks after an error has occurred. The
initial query has been modified to no longer rely upon catching an error
when attempting to detect the appropriate system view. Additionally, to
better support this database's very specific "rollback" behavior,
implemented new parameter ``ignore_no_transaction_on_rollback`` indicating
that a rollback should ignore Azure Synapse error 'No corresponding
transaction found. (111214)', which is raised if no transaction is present
in conflict with the Python DBAPI.

Fixes: #8231
Closes: #8233
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8233
Pull-request-sha: c48bd44a9f53d00e5e94f1b8bf996711b6419562

Change-Id: I6407a03148f45cc9eba8fe1d31d4f59ebf9c7ef7
doc/build/changelog/unreleased_14/8231.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/mssql/pyodbc.py
test/dialect/mssql/test_engine.py