Skip site navigation (1) Skip section navigation (2)

Re: XA Xid to PostgreSQL transaction ID

From: Kris Jurka <books(at)ejurka(dot)com>
To: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: XA Xid to PostgreSQL transaction ID
Date: 2010-10-19 19:06:25
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc

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 

> 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

In response to


pgsql-jdbc by date

Next:From: Michael mussetDate: 2010-10-19 19:31:33
Subject: JDBC4 with SQLXML and postgresql-8.4-702.jdbc4.jar
Previous:From: Kris JurkaDate: 2010-10-19 18:47:41
Subject: Re: DatabaseMetaData.getTablePrivileges()

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group