Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #886, simple fixes for twophase methods #887

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions aiopg/sa/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,12 @@ async def _prepare_twophase_impl(self, xid):
async def recover_twophase(self):
"""Return a list of prepared twophase transaction ids."""
result = await self.execute("SELECT gid FROM pg_prepared_xacts")
return [row[0] for row in result]
return [row[0] async for row in result]

async def rollback_prepared(self, xid, *, is_prepared=True):
"""Rollback prepared twophase transaction."""
if is_prepared:
await self.execute(f"ROLLBACK PREPARED {xid:!r}")
await self.execute(f"ROLLBACK PREPARED {xid!r}")
else:
await self._rollback_impl()

Expand Down
1 change: 0 additions & 1 deletion docs/sa.rst
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ Connection

.. comethod:: begin_twophase(xid=None)
:coroutine:
:async-with:

Begin a two-phase or XA transaction and return a transaction
handle.
Expand Down