Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.

Commit 055eba8

Browse files
committed
bug: don't rollback non-spanner connections on reset
This is the simplest way to address bug #706 and address the `AttributeError: 'Connection' object has no attribute 'rollback'` I'm seeing when connections from BigQuery engines get caught by this event handler. I think we should be able to rely on SQLAlchemy's [reset on return](https://docs.sqlalchemy.org/en/20/core/pooling.html#reset-on-return) behaviour to rollback transactions when they're reset rather than call rollback ourselves. That behaviour is also something end users can configure, so it'd be good to respect their settings if they disable the behaviour. Fixes: #706
1 parent 4a6d965 commit 055eba8

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ def reset_connection(dbapi_conn, connection_record, reset_state=None):
7171

7272
dbapi_conn.staleness = None
7373
dbapi_conn.read_only = False
74-
else:
75-
dbapi_conn.rollback()
7674

7775

7876
# register a method to get a single value of a JSON object

0 commit comments

Comments
 (0)