From: Ants Aasma Date: Wed, 10 Oct 2007 15:38:01 +0000 (+0000) Subject: make two-phase transactions work a bit better by letting psycopg do whatever it does... X-Git-Tag: rel_0_4_0~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6278f14da15f79dba759ae89563419eab433828f;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git make two-phase transactions work a bit better by letting psycopg do whatever it does for implicit transaction starts --- diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index 5d6773789a..80a5c1f401 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -319,6 +319,7 @@ class PGDialect(default.DefaultDialect): connection.execute(sql.text("ROLLBACK")) connection.execute(sql.text("ROLLBACK PREPARED %(tid)s", bindparams=[sql.bindparam('tid', xid)])) connection.execute(sql.text("BEGIN")) + self.do_rollback(connection.connection) else: self.do_rollback(connection.connection) @@ -328,6 +329,7 @@ class PGDialect(default.DefaultDialect): connection.execute(sql.text("ROLLBACK")) connection.execute(sql.text("COMMIT PREPARED %(tid)s", bindparams=[sql.bindparam('tid', xid)])) connection.execute(sql.text("BEGIN")) + self.do_rollback(connection.connection) else: self.do_commit(connection.connection)