pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Niels Beekman <n.beekman@wis.nl>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: XA rollback problem
Date: Mon, 24 Apr 2006 00:59:10 -0500 (EST)
Message-ID: <Pine.BSO.4.63.0604240047370.5837@leary2.csoft.net> (raw)
In-Reply-To: <50CA25BD6EEA954FA592C097399942E30E463D86@CM1.wis.local>
References: <50CA25BD6EEA954FA592C097399942E30E463D86@CM1.wis.local>



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



view thread (8+ messages)  latest in thread

Message-ID: <Pine.BSO.4.63.0604240047370.5837@leary2.csoft.net>
Permalink:  ../Pine.BSO.4.63.0604240047370.5837@leary2.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.63.0604240047370.5837@leary2.csoft.net

 · 

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: books@ejurka.com, n.beekman@wis.nl
  Subject: Re: XA rollback problem
  In-Reply-To: <Pine.BSO.4.63.0604240047370.5837@leary2.csoft.net>
  References: <50CA25BD6EEA954FA592C097399942E30E463D86@CM1.wis.local> <Pine.BSO.4.63.0604240047370.5837@leary2.csoft.net>

* 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