X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 5D23C11F6602 for ; Mon, 24 Apr 2006 02:59:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 92043-03 for ; Mon, 24 Apr 2006 02:59:12 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by postgresql.org (Postfix) with SMTP id 4CBFF11F65C9 for ; Mon, 24 Apr 2006 02:59:11 -0300 (ADT) Received: (qmail 23414 invoked by uid 1112); 24 Apr 2006 05:59:10 -0000 Date: Mon, 24 Apr 2006 00:59:10 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary2.csoft.net To: Niels Beekman cc: pgsql-jdbc@postgresql.org Subject: Re: XA rollback problem In-Reply-To: <50CA25BD6EEA954FA592C097399942E30E463D86@CM1.wis.local> Message-ID: References: <50CA25BD6EEA954FA592C097399942E30E463D86@CM1.wis.local> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/150 X-Sequence-Number: 15084 On Sat, 22 Apr 2006, Niels Beekman wrote: > The problem occurs when calling conn.close(), if you move the close() > after the commit() it works just fine. I think the connection gets > invalidated while it should stay active because it still has to commit > or rollback (whatever the transactionmanager requests). > Indeed the closing before committing is a problem. The PGXADatasource code is piggybacking on the PooledConnection code. When you close a PooledConnection a rollback occurs so that the connection can be reused. For the XAConnection it must put the connection into a pending-closed state and wait for the transaction manager to commit or rollback the connection. It'll be a little tricky to make this work for both the PooledConnection and XAConnection cases, but I'll take a look at that this week. Also to test this I added pg support to Simple JTA, but this required adjusting the PGXADatasource code to have a setUrl method. Did you do the same or do you have a simpler way of testing? Kris Jurka