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

Current approach doesn't work with two-phase commit #20

Open
jimfulton opened this issue Mar 18, 2017 · 1 comment
Open

Current approach doesn't work with two-phase commit #20

jimfulton opened this issue Mar 18, 2017 · 1 comment

Comments

@jimfulton
Copy link

Because Postgres doesn't allow PREPARE of transactions that have notified:

cannot PREPARE a transaction that has executed LISTEN, UNLISTEN, or NOTIFY

whimper.

The notify wouldn't necessarily have to be in the same transaction as writing to the queue.

I'm going to try to hack around this:

  • Remove the trigger after calling create()

  • Modify my code to notify in an after commit hook.

No action for you at this time. This is a FYI.

@jimfulton
Copy link
Author

I just released:

https://pypi.python.org/pypi/psycopg2transaction

To use this with pq, I have to remove the trigger and then get psycopg2transaction to send the notification:

https://github.com/zc/twotieredkanban/blob/master/server/zc/twotieredkanban/email.py

It would be nice of create had an option to not create the trigger, but it's easy enough to drop it after the fact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant