Re: XAResource implementation - Mailing list pgsql-jdbc

From Heikki Linnakangas
Subject Re: XAResource implementation
Date
Msg-id 47275A50.2050201@enterprisedb.com
Whole thread Raw
In response to Re: XAResource implementation  (joël Winteregg <joel.winteregg@gmail.com>)
Responses Re: XAResource implementation  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: joël Winteregg
Date:
Subject: Re: XAResource implementation
Next
From: Heikki Linnakangas
Date:
Subject: Re: XAResource implementation