Re: XAResource implementation

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: joël Winteregg <joel(dot)winteregg(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: XAResource implementation
Date: 2007-10-30 16:22:40
Message-ID: 47275A50.2050201@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)postgresql(dot)xa(dot)PGXAConnection(at)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(dot)postgresql(dot)xa(dot)PGXAConnection(at)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(dot)postgresql(dot)xa(dot)PGXAConnection(at)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(dot)postgresql(dot)xa(dot)PGXAConnection(at)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(dot)postgresql(dot)xa(dot)PGXAConnection(at)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(dot)postgresql(dot)xa(dot)PGXAConnection(at)b6548 [thread: main] on:
07-10-28 12:37:53,442
...

Note how the PGXAConnection instance used above changes from
PGXAConnection(at)364641 to PGXAConnection(at)b6548(dot) 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Heikki Linnakangas 2007-10-30 16:28:22 Re: XAResource implementation
Previous Message joël Winteregg 2007-10-30 15:19:27 Re: XAResource implementation