summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-07-25 16:17:15 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-07-25 16:17:15 -0400
commit3c0efe508f4b02ca69db1f4855f5bfeb936ac9e9 (patch)
tree7978e33f58560c9c0b911a3c937fb7384a4c2e55 /lib/sqlalchemy
parentd92177cede956e4ca12e0fdad5021bdd54715161 (diff)
parenta9d8d752efb0459ef017c6f782dedb1f56cf2f34 (diff)
downloadsqlalchemy-3c0efe508f4b02ca69db1f4855f5bfeb936ac9e9.tar.gz
Merge remote-tracking branch 'origin/pr/117' into pg8000
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/pg8000.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/pg8000.py b/lib/sqlalchemy/dialects/postgresql/pg8000.py
index 589567d9e..68da5b6d7 100644
--- a/lib/sqlalchemy/dialects/postgresql/pg8000.py
+++ b/lib/sqlalchemy/dialects/postgresql/pg8000.py
@@ -171,4 +171,23 @@ class PGDialect_pg8000(PGDialect):
(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