From: | "Niels Beekman" <n(dot)beekman(at)wis(dot)nl> |
---|---|
To: | "Kris Jurka" <books(at)ejurka(dot)com> |
Cc: | <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: XA rollback problem |
Date: | 2006-04-24 06:48:28 |
Message-ID: | 50CA25BD6EEA954FA592C097399942E30E463D92@CM1.wis.local |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
I'm glad that you were able to reproduce. Would be very nice if you
could fix it this week.
About the SimpleJTA: I passed the properties as a string separated by a
;, then split the properties again and pass them to the datasource using
the ClassUtils. invokeMethod(). Would be convenient when the datasource
had a setUrl(), but it's really SimpleJTA's job.
Niels
-----Original Message-----
From: Kris Jurka [mailto:books(at)ejurka(dot)com]
Sent: maandag 24 april 2006 7:59
To: Niels Beekman
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] XA rollback problem
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
From | Date | Subject | |
---|---|---|---|
Next Message | Kris Jurka | 2006-04-24 07:31:46 | Re: XA rollback problem |
Previous Message | Kris Jurka | 2006-04-24 05:59:10 | Re: XA rollback problem |