Re: a simple example of XA (not working)

From: Luca Ferrari <fluca1978(at)infinito(dot)it>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: a simple example of XA (not working)
Date: 2007-06-17 12:19:24
Message-ID: 200706171419.24206.fluca1978@infinito.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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.

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Albe Laurenz 2007-06-18 10:18:41 SSL support for javax.sql.DataSource
Previous Message Heikki Linnakangas 2007-06-17 07:40:28 Re: a simple example of XA (not working)