Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 809e6ab

Browse filesBrowse files
author
Ilya Gurov
authored
fix: rollback failed exception log (googleapis#106)
1 parent b5e1a21 commit 809e6ab
Copy full SHA for 809e6ab

File tree

Expand file treeCollapse file tree

1 file changed

+6
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-7
lines changed

‎google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py

Copy file name to clipboardExpand all lines: google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py
+6-7Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -800,13 +800,12 @@ def do_rollback(self, dbapi_connection):
800800
To prevent rollback exception, don't rollback
801801
committed/rolled back transactions.
802802
"""
803-
if (
804-
not isinstance(dbapi_connection, spanner_dbapi.Connection)
805-
and dbapi_connection.connection._transaction
806-
and (
807-
dbapi_connection.connection._transaction.rolled_back
808-
or dbapi_connection.connection._transaction.committed
809-
)
803+
if not isinstance(dbapi_connection, spanner_dbapi.Connection):
804+
dbapi_connection = dbapi_connection.connection
805+
806+
if dbapi_connection._transaction and (
807+
dbapi_connection._transaction.rolled_back
808+
or dbapi_connection._transaction.committed
810809
):
811810
pass
812811
else:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.