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);