From: Kris Jurka <books@ejurka.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
To: pg@fastcrypt.com
Cc: pgsql-jdbc@postgresql.org
Subject: Re: XADataSource interface
Date: Sat, 29 Oct 2005 14:12:06 -0500 (EST)
Message-ID: <Pine.BSO.4.61.0510291322220.5976@leary.csoft.net> (raw)
In-Reply-To: <Pine.OSF.4.61.0510251957390.145307@kosh.hut.fi>
References: <Pine.OSF.4.61.0510251957390.145307@kosh.hut.fi>
On Tue, 25 Oct 2005, Heikki Linnakangas wrote:
> I posted an updated version of the XADataSource implementation few weeks ago,
> but haven't received any comments:
>
Dave has committed this and I've made some further integration fixes to
it, but some of the tests you've provided fail with the attached errors.
I don't know much about XA, so I wanted to run some potential fixes by you
guys first. Thoughts?
Kris Jurka
Attachments:errors.txt (text/plain, 1.9K) download
Buildfile: build.xml
prepare:
check_versions:
check_driver:
driver:
compile:
examples:
jar:
testjar:
runtest:
[junit] Testsuite: org.postgresql.test.xa.XATestSuite
[junit] Tests run: 5, Failures: 0, Errors: 3, Time elapsed: 0.287 sec
[junit] Testcase: testOnePhase(org.postgresql.test.xa.XADataSourceTest): Caused an ERROR
[junit] Not implemented: one-phase commit must be issued using the same connection that was used to start it
[junit] org.postgresql.xa.PGXAException: Not implemented: one-phase commit must be issued using the same connection that was used to start it
[junit] at org.postgresql.xa.PGXAConnection.commitOnePhase(PGXAConnection.java:342)
[junit] at org.postgresql.xa.PGXAConnection.commit(PGXAConnection.java:319)
[junit] at org.postgresql.test.xa.XADataSourceTest.testOnePhase(XADataSourceTest.java:133)
[junit] Testcase: testRecover(org.postgresql.test.xa.XADataSourceTest): Caused an ERROR
[junit] null
[junit] java.lang.NullPointerException
[junit] at org.postgresql.test.xa.XADataSourceTest$CustomXid.equals(XADataSourceTest.java:117)
[junit] at org.postgresql.xa.PGXAConnection.rollback(PGXAConnection.java:276)
[junit] at org.postgresql.test.xa.XADataSourceTest.testRecover(XADataSourceTest.java:170)
[junit] Testcase: testRollback(org.postgresql.test.xa.XADataSourceTest): Caused an ERROR
[junit] null
[junit] java.lang.NullPointerException
[junit] at org.postgresql.test.xa.XADataSourceTest$CustomXid.equals(XADataSourceTest.java:117)
[junit] at org.postgresql.xa.PGXAConnection.rollback(PGXAConnection.java:276)
[junit] at org.postgresql.test.xa.XADataSourceTest.testRollback(XADataSourceTest.java:196)
[junit] Test org.postgresql.test.xa.XATestSuite FAILED
test:
BUILD SUCCESSFUL
Total time: 1 second
fixes.patch (text/plain, 1.8K) download
Index: org/postgresql/xa/PGXAConnection.java
===================================================================
RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/xa/PGXAConnection.java,v
retrieving revision 1.2
diff -c -r1.2 PGXAConnection.java
*** org/postgresql/xa/PGXAConnection.java 29 Oct 2005 18:59:39 -0000 1.2
--- org/postgresql/xa/PGXAConnection.java 29 Oct 2005 19:05:09 -0000
***************
*** 172,178 ****
throw new PGXAException(GT.tr("Prepare called before end"), XAException.XAER_INVAL);
state = STATE_IDLE;
! currentXid = null;
if (!conn.haveMinimumServerVersion("8.1"))
throw new PGXAException(GT.tr("Server versions prior to 8.1 do not support two-phase commit."), XAException.XAER_RMERR);
--- 172,178 ----
throw new PGXAException(GT.tr("Prepare called before end"), XAException.XAER_INVAL);
state = STATE_IDLE;
! // currentXid = null;
if (!conn.haveMinimumServerVersion("8.1"))
throw new PGXAException(GT.tr("Server versions prior to 8.1 do not support two-phase commit."), XAException.XAER_RMERR);
***************
*** 335,341 ****
try
{
// Check preconditions
! if (currentXid == null || currentXid.equals(xid))
{
// In fact, we don't know if xid is bogus, or if it just wasn't associated with this connection.
// Assume it's our fault.
--- 335,341 ----
try
{
// Check preconditions
! if (currentXid == null || !currentXid.equals(xid))
{
// In fact, we don't know if xid is bogus, or if it just wasn't associated with this connection.
// Assume it's our fault.
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, hlinnaka@iki.fi, pg@fastcrypt.com
Subject: Re: XADataSource interface
In-Reply-To: <Pine.BSO.4.61.0510291322220.5976@leary.csoft.net>
References: <Pine.OSF.4.61.0510251957390.145307@kosh.hut.fi> <Pine.BSO.4.61.0510291322220.5976@leary.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