Skip to content

Commit

Permalink
fix: rollback failed exception log (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Gurov committed Sep 10, 2021
1 parent b5e1a21 commit 809e6ab
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py
Expand Up @@ -800,13 +800,12 @@ def do_rollback(self, dbapi_connection):
To prevent rollback exception, don't rollback
committed/rolled back transactions.
"""
if (
not isinstance(dbapi_connection, spanner_dbapi.Connection)
and dbapi_connection.connection._transaction
and (
dbapi_connection.connection._transaction.rolled_back
or dbapi_connection.connection._transaction.committed
)
if not isinstance(dbapi_connection, spanner_dbapi.Connection):
dbapi_connection = dbapi_connection.connection

if dbapi_connection._transaction and (
dbapi_connection._transaction.rolled_back
or dbapi_connection._transaction.committed
):
pass
else:
Expand Down

0 comments on commit 809e6ab

Please sign in to comment.