mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-10 19:16:34 +03:00
Use 'autocommit' to check if to rollback after extra types registration
isolation_level currently requires an extra query, autocommit doesn't.
This commit is contained in:
parent
bb8e1e9455
commit
a4485022b5
|
@ -704,7 +704,7 @@ WHERE typname = 'hstore';
|
|||
|
||||
# revert the status of the connection as before the command
|
||||
if (conn_status != _ext.STATUS_IN_TRANSACTION
|
||||
and conn.isolation_level != _ext.ISOLATION_LEVEL_AUTOCOMMIT):
|
||||
and not conn.autocommit):
|
||||
conn.rollback()
|
||||
|
||||
return tuple(rv0), tuple(rv1)
|
||||
|
@ -921,7 +921,7 @@ ORDER BY attnum;
|
|||
|
||||
# revert the status of the connection as before the command
|
||||
if (conn_status != _ext.STATUS_IN_TRANSACTION
|
||||
and conn.isolation_level != _ext.ISOLATION_LEVEL_AUTOCOMMIT):
|
||||
and not conn.autocommit):
|
||||
conn.rollback()
|
||||
|
||||
if not recs:
|
||||
|
|
Loading…
Reference in New Issue
Block a user