]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Merge remote-tracking branch 'origin/pr/117' into pg8000
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 25 Jul 2014 20:17:15 +0000 (16:17 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 25 Jul 2014 20:17:15 +0000 (16:17 -0400)
1  2 
lib/sqlalchemy/dialects/postgresql/pg8000.py

index 589567d9e9d76c9c482f99858962d0edf413dbd9,dd63d7ea8a22f6910002cc6ebc9c6136e32dc0c6..68da5b6d7c5c75e5378c4f51e467f38ba0c8832f
@@@ -169,6 -165,25 +169,25 @@@ class PGDialect_pg8000(PGDialect)
                  "Invalid value '%s' for isolation_level. "
                  "Valid isolation levels for %s are %s or AUTOCOMMIT" %
                  (level, self.name, ", ".join(self._isolation_lookup))
 -                )
 +            )
  
+     def do_begin_twophase(self, connection, xid):
+         print("begin twophase", xid)
+         connection.connection.tpc_begin((0, xid, ''))
+     def do_prepare_twophase(self, connection, xid):
+         print("prepare twophase", xid)
+         connection.connection.tpc_prepare()
+     def do_rollback_twophase(
+             self, connection, xid, is_prepared=True, recover=False):
+         connection.connection.tpc_rollback((0, xid, ''))
+     def do_commit_twophase(
+             self, connection, xid, is_prepared=True, recover=False):
+         connection.connection.tpc_commit((0, xid, ''))
+     def do_recover_twophase(self, connection):
+         return [row[1] for row in connection.connection.tpc_recover()]
  dialect = PGDialect_pg8000