two phase commit support in Engine/Connection + implementation for postgres

Issue #519 resolved
Mike Bayer repo owner created an issue

a patch discussed on the mailing list.

Comments (5)

  1. Mike Bayer reporter

    this patch also needs a prepare() method added to Transaction, and a call to prepare() within SessionTransaction if multiple engines are present.

    lets also consider adding an explicit prepare() to SessionTransaction which for example can be used by Zalchemy in its two-phase implementation. prepare() should actually perform all flush() operations as well as call prepare() on all its stored Transactions.

  2. Former user Account Deleted

    Replying to zzzeek:

    this patch also needs a prepare() method added to Transaction, and a call to prepare() within SessionTransaction if multiple engines are present.

    That should already be there.

    lets also consider adding an explicit prepare() to SessionTransaction which for example can be used by Zalchemy in its two-phase implementation. prepare() should actually perform all flush() operations as well as call prepare() on all its stored Transactions.

    I can sort this out and re-submit if you'd like.

  3. Former user Account Deleted

    (original author: ants) Support for two phase commit added in 2896. Currently works for MySQL and Postgresql.

    API:

    transaction = connection.begin_twophase()
    # do work
    transaction.prepare()
    # prepare other work
    transaction.commit()
    

    Still needs slight adjustments to support XA transaction branch qualifiers.

  4. Log in to comment