pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki@enterprisedb.com>
To: joël Winteregg <joel.winteregg@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: XAResource implementation
Date: Tue, 30 Oct 2007 16:22:40 +0000
Message-ID: <47275A50.2050201@enterprisedb.com> (raw)
In-Reply-To: <1193757567.5565.46.camel@hatman>
References: <1193736934.5565.40.camel@hatman>
	<4727420A.4060209@enterprisedb.com>
	<1193757567.5565.46.camel@hatman>

joël Winteregg wrote:
> Hello Heikki,
> 
> Thanks for your answer. Yes, i'm using the following jdbc driver
> version: 8.2-506.jdbc4.jar
> 
> Do you have any other idea ? Should I tune something for the jdbc
> driver ?

Hmm. Looking at the logs on that forum, apparently Atomikos calls 
XAResource.start(TMJOIN) using a different connection:

XAResourceTransaction 127.0.0.1.tm0000100044127.0.0.1.tm1: about to 
switch to XAResource org.postgresql.xa.PGXAConnection@364641 [thread: 
main] on: 07-10-28 12:37:53,333
XAResourceTransaction 127.0.0.1.tm0000100044127.0.0.1.tm1: switched to 
XAResource org.postgresql.xa.PGXAConnection@364641 [thread: main] on: 
07-10-28 12:37:53,333
...
XAResource.start ( 127.0.0.1.tm0000100044127.0.0.1.tm1 , 
XAResource.TMNOFLAGS ) called on resource testDS1 represented by 
XAResource instance org.postgresql.xa.PGXAConnection@364641 [thread: 
main] on: 07-10-28 12:37:53,335
...
XAResource.end ( 127.0.0.1.tm0000100044127.0.0.1.tm1 , 
XAResource.TMSUCCESS ) called on resource testDS1 represented by 
XAResource instance org.postgresql.xa.PGXAConnection@364641 [thread: 
main] on: 07-10-28 12:37:53,434
...
XAResourceTransaction 127.0.0.1.tm0000100044127.0.0.1.tm1: about to 
switch to XAResource org.postgresql.xa.PGXAConnection@b6548 [thread: 
main] on: 07-10-28 12:37:53,441
XAResourceTransaction 127.0.0.1.tm0000100044127.0.0.1.tm1: switched to 
XAResource org.postgresql.xa.PGXAConnection@b6548 [thread: main] on: 
07-10-28 12:37:53,442
...

Note how the PGXAConnection instance used above changes from 
PGXAConnection@364641 to PGXAConnection@b6548. Unfortunately that's the 
kind of transaction interleaving that we don't support.

You said you tried setExclusiveConnectionMode(true), but I think there's 
something wrong with that. If I'm reading the Atomikos source code 
right, in exclusive connection mode it should use 
ExclusiveExternalXAPooledConnectionImp, but in your case it's using 
ExternalXAPooledConnectionImp, which according to the source code is 
used when not in exclusive connection mode. Are you sure you set that 
parameter in the right place?

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



view thread (18+ messages)  latest in thread

Message-ID: <47275A50.2050201@enterprisedb.com>
Permalink:  ../47275A50.2050201@enterprisedb.com/
Also on:    postgresql.org/message-id/47275A50.2050201@enterprisedb.com

 · 

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: heikki@enterprisedb.com, joel.winteregg@gmail.com
  Subject: Re: XAResource implementation
  In-Reply-To: <47275A50.2050201@enterprisedb.com>
  References: <1193736934.5565.40.camel@hatman> <4727420A.4060209@enterprisedb.com> <1193757567.5565.46.camel@hatman> <47275A50.2050201@enterprisedb.com>

* 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