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 02:31:46 -0500 (EST)
Message-ID: <Pine.BSO.4.63.0604240230080.28054@leary2.csoft.net> (raw)
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>
On Mon, 24 Apr 2006, Kris Jurka wrote:
> 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?
>
If anyone else is interested in looking at this the attached patch adds a
test for this situation to our existing regression tests.
Kris Jurka
Attachments:xa-close-before-commit-test.patch (text/plain, 1.2K) download
Index: org/postgresql/test/xa/XADataSourceTest.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/test/xa/XADataSourceTest.java,v
retrieving revision 1.5
diff -c -r1.5 XADataSourceTest.java
*** org/postgresql/test/xa/XADataSourceTest.java 24 Nov 2005 02:31:44 -0000 1.5
--- org/postgresql/test/xa/XADataSourceTest.java 24 Apr 2006 07:28:17 -0000
***************
*** 142,147 ****
--- 142,160 ----
xaRes.commit(xid, false);
}
+ public void testCloseBeforeCommit() throws Exception {+ Xid xid = new CustomXid(5);+ xaRes.start(xid, XAResource.TMNOFLAGS);+ assertEquals(1, conn.createStatement().executeUpdate("INSERT INTO testxa1 VALUES (1)"));+ conn.close();+ xaRes.end(xid, XAResource.TMSUCCESS);+ xaRes.commit(xid, true);+ + ResultSet rs = _conn.createStatement().executeQuery("SELECT foo FROM testxa1");+ assertTrue(rs.next());+ assertEquals(1, rs.getInt(1));+ }+
public void testRecover() throws Exception {
Xid xid = new CustomXid(12345);
xaRes.start(xid, XAResource.TMNOFLAGS);
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.0604240230080.28054@leary2.csoft.net>
References: <50CA25BD6EEA954FA592C097399942E30E463D86@CM1.wis.local> <Pine.BSO.4.63.0604240047370.5837@leary2.csoft.net> <Pine.BSO.4.63.0604240230080.28054@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