Re: 1300 to 3100 lines of code for XA support

From: Aaron Mulder <ammulder(at)alumni(dot)princeton(dot)edu>
To: PostgreSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: 1300 to 3100 lines of code for XA support
Date: 2004-11-02 21:12:10
Message-ID: Pine.LNX.4.58.0411021537540.13637@saturn.opentools.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I don't think there was a point to pretending to have XA support
when the product really doesn't have it, and on top of that it actually
makes the situation worse.

The only possible safe way to include PostgreSQL in an XA
transaction is to involve at most one local (PostgreSQL) resource, and
prepare it last and commit it first. That could be done by an application
server if it manages the process and knows that the PostgreSQL driver is
just a local resource. But if the PostgreSQL driver pretends to be an XA
resource, then the app server can't tell that PostgreSQL is really just
using a local transaction under the covers, so it thinks it has all XA
resources and can't arrange for the local one to go in the correct order.
So again, a fake XA implementation specifically defeats the one possible
safe way to include a local resource in an XA transaction.

Aaron

On Tue, 2 Nov 2004, Vadim Nasardinov wrote:
> On Tuesday 02 November 2004 15:09, Kris Jurka wrote:
> > You might be interested to know that pg used to have a fake XA
> > implementation in the driver as well.
> >
> > http://gborg.postgresql.org/project/pgjdbc/cvs/cvs.php/pgjdbc/org/postgresql/xa?sa=1
>
> Yes, I've seen this. As I mentioned in the original post:
>
> | As a side note, it looks like the PostgreSQL JDBC driver used to
> | provide emulated XA support [11].
> | [...]
> | Footnotes
> | [...]
> | 11. http://people.redhat.com/~vadimn/scratch/pgsql-jdbc/changelog.html#2002-08-14-16:35
>
> The commit message by "barry" (Barry Lind?) does not elaborate
> on the reasons why these classes were removed:
>
> | Also note that this checkin removes the PostgresqlDataSource and
> | files in the xa directory. A recent checkin has added new
> | datasource support that replaces the functionality provided by
> | these classes.
>
> Do you know why this code was removed? (That is, aside from the fact that it
> couldn't possibly work.)
>
>
> Thanks,
> Vadim
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2004-11-02 21:19:19 Re: executeBatch() issue with new driver?
Previous Message Oliver Jowett 2004-11-02 20:55:23 Re: executeBatch() issue with new driver?