File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
google/cloud/sqlalchemy_spanner Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 4848@listens_for (Pool , "reset" )
4949def reset_connection (dbapi_conn , connection_record ):
5050 """An event of returning a connection back to a pool."""
51- if dbapi_conn .connection .inside_transaction :
52- dbapi_conn .connection .rollback ()
51+ if isinstance (dbapi_conn .connection , spanner_dbapi .Connection ):
52+ if dbapi_conn .connection .inside_transaction :
53+ dbapi_conn .connection .rollback ()
5354
54- if getattr (dbapi_conn .connection , "staleness" , None ) is not None :
5555 dbapi_conn .connection .staleness = None
56-
57- if getattr (dbapi_conn .connection , "read_only" , None ) is not None :
5856 dbapi_conn .connection .read_only = False
57+ else :
58+ dbapi_conn .connection .rollback ()
5959
6060
6161# register a method to get a single value of a JSON object
You can’t perform that action at this time.
0 commit comments