From 6278f14da15f79dba759ae89563419eab433828f Mon Sep 17 00:00:00 2001 From: Ants Aasma Date: Wed, 10 Oct 2007 15:38:01 +0000 Subject: make two-phase transactions work a bit better by letting psycopg do whatever it does for implicit transaction starts --- lib/sqlalchemy/databases/postgres.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/sqlalchemy/databases/postgres.py') diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index 5d6773789..80a5c1f40 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) -- cgit v1.2.1