[DB-SIG] DBAPI two phase commit implementation in psycopg2

Daniele Varrazzo daniele.varrazzo at gmail.com
Tue Sep 28 11:07:50 CEST 2010


On Tue, Sep 28, 2010 at 8:09 AM, James Henstridge <james at jamesh.id.au> wrote:

> When writing the TPC additions for the spec, I did take PostgreSQL
> into account (I thought I'd have time to write the psycopg2
> implementation back then).  The reasoning for using the three part
> identifiers was that the XA-style identifiers were quite common and it
> was easier to losslessly encode the three part identifiers as a string
> than vice versa.
>
> The spec should allow you to manage identifiers that don't match your
> mapping though.  The user can only get references to transaction ID
> objects via method calls on the connection.  So while transaction IDs
> are required to provide tuple like behaviour, the adapter doesn't have
> to use actual tuple objects.  A custom object type could easily be
> used here to round trip the foreign IDs between tpc_recover() and
> tpc_commit()/tpc_abort().

Thank you James. I've found your code on launchpad with the Xid
implementation and it seems a great starting point. I know well enough
how the state in psycopg connections is handled so there should be no
problem to complete the implementation.

Regards,

-- Daniele


More information about the DB-SIG mailing list