Skip to content

Commit 13ff9cb

Browse files
Ilya Gurovvi3k6i5
andauthored
feat: rollback a connection returned back to pool (googleapis#193)
* feat: drop read_only on a connection returned back to a pool * feat: rollback a connection returned back to pool Co-authored-by: Vikash Singh <3116482+vi3k6i5@users.noreply.github.com>
1 parent 16388c1 commit 13ff9cb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
@listens_for(Pool, "reset")
4949
def reset_connection(dbapi_conn, connection_record):
5050
"""An event of returning a connection back to a pool."""
51+
dbapi_conn.connection.rollback()
5152
if getattr(dbapi_conn.connection, "staleness", None) is not None:
5253
dbapi_conn.connection.staleness = None
5354

0 commit comments

Comments
 (0)