Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id D2DC29FB3D9 for ; Sun, 17 Jun 2007 09:19:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 76090-02 for ; Sun, 17 Jun 2007 09:19:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from smtp3.libero.it (smtp3.libero.it [193.70.192.127]) by postgresql.org (Postfix) with ESMTP id F048E9FB3D3 for ; Sun, 17 Jun 2007 09:19:26 -0300 (ADT) Received: from smtp-out1.libero.it (192.168.32.25) by smtp3.libero.it (7.2.079) id 4674090F00025D33 for pgsql-jdbc@postgresql.org; Sun, 17 Jun 2007 14:19:24 +0200 Received: from mailrelay07.libero.it (172.31.0.114) by smtp-out1.libero.it (7.3.120) id 4611FD18051203E7 for pgsql-jdbc@postgresql.org; Sun, 17 Jun 2007 14:19:24 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAM/DdEaXJeMQdGdsb2JhbACBTo1nATc Received: from adsl-16-227.37-151.net24.it (HELO fluca.local) ([151.37.227.16]) by outrelay07.libero.it with ESMTP; 17 Jun 2007 14:19:24 +0200 From: Luca Ferrari To: Heikki Linnakangas , pgsql-jdbc@postgresql.org Subject: Re: a simple example of XA (not working) Date: Sun, 17 Jun 2007 14:19:24 +0200 User-Agent: KMail/1.9.7 References: <200706161607.52540.fluca1978@infinito.it> <4674E56C.8060802@enterprisedb.com> In-Reply-To: <4674E56C.8060802@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706171419.24206.fluca1978@infinito.it> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.136 tagged_above=0 required=5 tests=BAYES_50=0.001, FORGED_RCVD_HELO=0.135 X-Spam-Level: X-Archive-Number: 200706/52 X-Sequence-Number: 17114 Thanks for your help, I'm happy we have identified and corrected a bug in the driver! Luca On Sunday 17 June 2007 your cat, walking on the keyboard, wrote: > This seems to be an undesired side-effect of this patch that was > > committed in December: > > date: 2006/12/01 10:13:46; author: jurka; state: Exp; lines: +19 -22 > > A XAConnections default autocommit state should be true. The > > driver was previously setting autocommit to false and assuming it > > would stay that way. This caused two problems. First, some > > applications expected to be able to issue local autocommit > > transactions prior to begin(). Second, some TMs (Geronimo) set the > > autocommit state to true themselves, which causes problems as the > > driver did not expect it to be changed. This patch correctly disables > > and enables autocommit around begin, prepare, commit, and rollback > > methods. > > getConnection sets autocommit to false, so even though start set it to > true, it's reset to false in the call to getConnection. Attached patch > fixes that by explicitly setting autocommit to the right mode in > PGXAConnection.getConnection. > > As a work-around, just call jdbcConnection.setAutoCommit(false) in your > program before executing any queries.