]> 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 20:21:26 +0000 (16:21 -0400)
commitd62ebdefbb49d0f2fb6dce3f957a2254d894bdb7
treeae2b4d4277ec18f1b3eae4e5e22c2795a22db82c
parentdd9be7039496a9ad7f8a8e812644110383e46ec2
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
(cherry picked from commit 8fe3cd69c5f2d8f73e75fb19ae929273282fba57)
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