Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 70D6913364DE for ; Tue, 19 Oct 2010 16:06:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 29092-04 for ; Tue, 19 Oct 2010 19:06:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id F36E51335B36 for ; Tue, 19 Oct 2010 16:06:25 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 9477D2840E; Tue, 19 Oct 2010 15:06:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=VakSYXJsp/Gmdo/tkzxjyYVTIzM=; b=s4woMi wlRGH4Kjn+tCNIOEfXydQ8HR0NnXxsbZ9LDalL+ZJypKZxXvLNMCTrPLsYTkkJNY 5uLoNq37CBxqOo2TfY02k7bmWR7PtW0dHPgABb+qkB8YJojmBXdIeOkMEqZZxdl0 JdYFLPPqR3OHTiwmwKS0fjnFhV8sWVtMEWw/Q= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 8CFCF28404; Tue, 19 Oct 2010 15:06:25 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id 520E3A860; Tue, 19 Oct 2010 15:06:25 -0400 (EDT) Date: Tue, 19 Oct 2010 15:06:25 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Daniele Varrazzo cc: pgsql-jdbc@postgresql.org Subject: Re: XA Xid to PostgreSQL transaction ID In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/122 X-Sequence-Number: 21090 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