pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Luca Ferrari <fluca1978@infinito.it>
To: Heikki Linnakangas <heikki@enterprisedb.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: a simple example of XA (not working)
Date: Sun, 17 Jun 2007 14:19:24 +0200
Message-ID: <200706171419.24206.fluca1978@infinito.it> (raw)
In-Reply-To: <4674E56C.8060802@enterprisedb.com>
References: <200706161607.52540.fluca1978@infinito.it>
	<4674E56C.8060802@enterprisedb.com>

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.




view thread (6+ messages)  latest in thread

Message-ID: <200706171419.24206.fluca1978@infinito.it>
Permalink:  ../200706171419.24206.fluca1978@infinito.it/
Also on:    postgresql.org/message-id/200706171419.24206.fluca1978@infinito.it

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: fluca1978@infinito.it, heikki@enterprisedb.com
  Subject: Re: a simple example of XA (not working)
  In-Reply-To: <200706171419.24206.fluca1978@infinito.it>
  References: <200706161607.52540.fluca1978@infinito.it> <4674E56C.8060802@enterprisedb.com> <200706171419.24206.fluca1978@infinito.it>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox