From: Mike Bayer Date: Mon, 2 Sep 2024 15:22:36 +0000 (-0400) Subject: add "The server failed to resume the transaction" to pymssql X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac5a27db854fe9f6fbad5b93130e4a9c19405f3a;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git add "The server failed to resume the transaction" to pymssql Added error "The server failed to resume the transaction" to the list of error strings for the pymssql driver in determining a disconnect scenario, as observed by one user using pymssql under otherwise unknown conditions as leaving an unusable connection in the connection pool which fails to ping cleanly. Fixes: #11822 Change-Id: I1cf98046978b10775f19531878b597d32b056f13 --- diff --git a/doc/build/changelog/unreleased_20/11822.rst b/doc/build/changelog/unreleased_20/11822.rst new file mode 100644 index 0000000000..f6c91918f3 --- /dev/null +++ b/doc/build/changelog/unreleased_20/11822.rst @@ -0,0 +1,9 @@ +.. change:: + :tags: bug, mssql + :tickets: 11822 + + Added error "The server failed to resume the transaction" to the list of + error strings for the pymssql driver in determining a disconnect scenario, + as observed by one user using pymssql under otherwise unknown conditions as + leaving an unusable connection in the connection pool which fails to ping + cleanly. diff --git a/lib/sqlalchemy/dialects/mssql/pymssql.py b/lib/sqlalchemy/dialects/mssql/pymssql.py index ea1f9bd3a7..c4207987bc 100644 --- a/lib/sqlalchemy/dialects/mssql/pymssql.py +++ b/lib/sqlalchemy/dialects/mssql/pymssql.py @@ -103,6 +103,7 @@ class MSDialect_pymssql(MSDialect): "message 20006", # Write to the server failed "message 20017", # Unexpected EOF from the server "message 20047", # DBPROCESS is dead or not enabled + "The server failed to resume the transaction", ): if msg in str(e): return True diff --git a/test/dialect/mssql/test_engine.py b/test/dialect/mssql/test_engine.py index 557341aa6a..0e9d2fdcf0 100644 --- a/test/dialect/mssql/test_engine.py +++ b/test/dialect/mssql/test_engine.py @@ -375,6 +375,7 @@ class ParseConnectTest(fixtures.TestBase): "message 20006", # Write to the server failed "message 20017", # Unexpected EOF from the server "message 20047", # DBPROCESS is dead or not enabled + "The server failed to resume the transaction", ]: eq_(dialect.is_disconnect(error, None, None), True)