pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Daniele Varrazzo <daniele.varrazzo@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: XA Xid to PostgreSQL transaction ID
Date: Tue, 19 Oct 2010 15:06:25 -0400 (EDT)
Message-ID: <alpine.BSO.2.00.1010191459480.26102@leary.csoft.net> (raw)
In-Reply-To: <AANLkTikWBOaQ+2GXsGa2Mbq46mDK8CgwcU7yVkpkcVEg@mail.gmail.com>
References: <AANLkTikWBOaQ+2GXsGa2Mbq46mDK8CgwcU7yVkpkcVEg@mail.gmail.com>



On Thu, 14 Oct 2010, Daniele Varrazzo wrote:

> I have implemented two-phase commit into the Python PostgreSQL driver
> psycopg2. As the Python DBAPI is XA inspired, the transaction IDs it
> demands to handle are composed by triples (format_id, gtrid, bqual).
> PostgreSQL instead asks for plain strings as transaction IDs.
>
> I'd like to implement the mapping algorithm exactly the way the JDBC
> driver does, as it would allow tools written in Python to interoperate
> to ones written in Java and understand each other the XA components of
> the transaction IDs.
>

I'm not sure how valuable that will really be.  This information should 
really only be useful to a transaction manager(TM), so I'm not sure what 
interoperability would gain.  No TM is going to start a Java transaction 
and later try to recover it using a Python client (or the other way 
around).

> As a test I have in the test suite the triple (42, 'gtrid', 'bqual')
> is converted into the string '42_Z3RyaWQ=_YnF1YWw=': I'd like to know,
> if possible, if this is the same result obtained by the JDBC driver.
> Alternatively, if you can provide me one or more known triple ->
> string transformation examples, I can check them and add them to the
> test suite.

Yes, this is the same result as the JDBC driver.

Kris Jurka



view thread (3+ messages)  latest in thread

Message-ID: <alpine.BSO.2.00.1010191459480.26102@leary.csoft.net>
Permalink:  ../alpine.BSO.2.00.1010191459480.26102@leary.csoft.net/
Also on:    postgresql.org/message-id/alpine.BSO.2.00.1010191459480.26102@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, daniele.varrazzo@gmail.com
  Subject: Re: XA Xid to PostgreSQL transaction ID
  In-Reply-To: <alpine.BSO.2.00.1010191459480.26102@leary.csoft.net>
  References: <AANLkTikWBOaQ+2GXsGa2Mbq46mDK8CgwcU7yVkpkcVEg@mail.gmail.com> <alpine.BSO.2.00.1010191459480.26102@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox