X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 41B643A2B4A for ; Tue, 2 Nov 2004 21:09:19 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 96112-02 for ; Tue, 2 Nov 2004 21:09:08 +0000 (GMT) Received: from saturn.opentools.org (saturn.opentools.org [66.250.40.202]) by svr1.postgresql.org (Postfix) with ESMTP id EFA013A4064 for ; Tue, 2 Nov 2004 21:09:09 +0000 (GMT) Received: by saturn.opentools.org (Postfix, from userid 500) id B24523EC2; Tue, 2 Nov 2004 16:12:10 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by saturn.opentools.org (Postfix) with ESMTP id ADFC8F5BF for ; Tue, 2 Nov 2004 16:12:10 -0500 (EST) Date: Tue, 2 Nov 2004 16:12:10 -0500 (EST) From: Aaron Mulder X-X-Sender: ammulder@saturn.opentools.org To: PostgreSQL JDBC Subject: Re: 1300 to 3100 lines of code for XA support In-Reply-To: <200411021531.00415@vadim.nasardinov> Message-ID: References: <200410271617.28742@vadim.nasardinov> <200411021447.54010@vadim.nasardinov> <200411021531.00415@vadim.nasardinov> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/39 X-Sequence-Number: 11461 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@postgresql.org >