]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
make two-phase transactions work a bit better by letting psycopg do whatever it does...
authorAnts Aasma <ants.aasma@gmail.com>
Wed, 10 Oct 2007 15:38:01 +0000 (15:38 +0000)
committerAnts Aasma <ants.aasma@gmail.com>
Wed, 10 Oct 2007 15:38:01 +0000 (15:38 +0000)
transaction starts

lib/sqlalchemy/databases/postgres.py

index 5d6773789ae442ea6201db0706e15ec089a1dc70..80a5c1f401ecfb3d76ffdad9d2df8c023f918640 100644 (file)
@@ -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)