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:
Daniele Varrazzo 2011-12-15 19:28:04 +00:00
parent bb8e1e9455
commit a4485022b5

View File

@ -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: