Re: XA rollback problem - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: XA rollback problem
Date
Msg-id Pine.BSO.4.63.0604240047370.5837@leary2.csoft.net
Whole thread Raw
In response to Re: XA rollback problem  ("Niels Beekman" <n.beekman@wis.nl>)
Responses Re: XA rollback problem  (Kris Jurka <books@ejurka.com>)
Re: XA rollback problem  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc

On Sat, 22 Apr 2006, Niels Beekman wrote:

> The problem occurs when calling conn.close(), if you move the close()
> after the commit() it works just fine. I think the connection gets
> invalidated while it should stay active because it still has to commit
> or rollback (whatever the transactionmanager requests).
>

Indeed the closing before committing is a problem.  The PGXADatasource
code is piggybacking on the PooledConnection code.  When you close a
PooledConnection a rollback occurs so that the connection can be reused.
For the XAConnection it must put the connection into a pending-closed
state and wait for the transaction manager to commit or rollback the
connection.  It'll be a little tricky to make this work for both the
PooledConnection and XAConnection cases, but I'll take a look at that this
week.

Also to test this I added pg support to Simple JTA, but this required
adjusting the PGXADatasource code to have a setUrl method.  Did you do the
same or do you have a simpler way of testing?

Kris Jurka

pgsql-jdbc by date:

Previous
From: "Niels Beekman"
Date:
Subject: Re: XA rollback problem
Next
From: "Niels Beekman"
Date:
Subject: Re: XA rollback problem