On 01/21/2017 05:05 PM, Jonathan Vanasco wrote:
a given application makes explicit use of `commit` and `rollback` on the
sqlalchemy session.
a few views require interaction with some other technologies via a
two-phase commit.
under the current design, i can't enable two-phase commits for
everything. i'm not sure I can detect the need for a two-phase commit
early enough to use a dedicated session object. on postgresql (at
least), the two-phase commit arguments don't appear to be needed until
it's ready to commit.
I have a hope this might be possible, but alternatives if not (postgres
is the only "member" that could veto transactions in this application)
the thing about two phase is that usually the Session is coordinating
multiple databases together w/ two phase. Since the "two phase" for
Postgresql only starts out when it emits PREPARE, you theoretically
don't even need to say it when the transaction begins, although I think
the core internals are going to want a TwoPhaseTransaction object built
up at the front. You definitely should be able to set this flag for it
to take place on the next transaction; when it procures a DB connection
it will then use begin_twophase().
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and
Verifiable Example. See http://stackoverflow.com/help/mcve for a full
description.
---
You received this message because you are subscribed to the Google
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.