Jamie,

Could you try following patch for XAResourceTest.java. It is supposed to 
fix empty branch id problem.

Jamie Burns wrote:
> By way of reminder, the exception is:
> 
> javax.transaction.xa.XAException
>  at com.microsoft.jdbcx.base.BaseXAResource.checkXid(Unknown Source)
>  at com.microsoft.jdbcx.base.BaseXAResource.start(Unknown Source)
>  at
> org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnec
> tion.java:107)
>  at
> org.jboss.test.jca.tm.XAResourceTest.testSimpleCommitXid(XAResourceTest.java
> :173)
> 
> The checkXid method is failing with the value it is getting from
> XidImpl.getBranchQualifier(). XidImpl is returning a byte[0]. Ive started
> comparing it to the JBoss 3.0 code and it looks pretty the same. Im guessing
> that somewhere JBoss 3.0 was setting it to a non-zero length array. I am
> going to look into it more closely over the weekend.
> 
> ----- Original Message -----
> From: "Igor Fedorenko" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, September 07, 2002 2:18 PM
> Subject: Re: [JBoss-dev] XADataSource wrapper for JBoss 4
> 
> 
> 
>>There are two types of tests in this test suite. First type ("raw"
>>tests) manages xids and makes xa calls directly, second type ("tx"
>>tests) create instance of Transaction and use this instance to manage xa
>>stuff. "Tx" tests are more important because they exercise actual
>>behaviour of jboss, while "raw" tests were meant to prove that very
>>basic xa functionality works. In your case all "raw" tests failed and
>>all "tx" tests succeeded. It is definitely a bug with raw tests but I do
>>not know what could be wrong with them.
>>
>>Jamie Burns wrote:
>>
>>>Ok. The XAResourceUnitTestCase threw 3 errors. See attached report.
>>>
>>>There are sections for 3 adapters in the class. I have hsqldb-ds.xml
>>>(Firebird?) and mssql-xa-ds.xml installed. Apart from removing one of
>>
> them,
> 
>>>how do you tell which one has failed?
>>>
>>>Thanks
>>>
>>>Jamie
>>>
>>
>>
>>--
>>Igor Fedorenko
>>Think smart. Think automated. Think Dynamics.
>>www.thinkdynamics.com
>>
>>
>>
>>-------------------------------------------------------
>>This sf.net email is sponsored by: OSDN - Tired of that same old
>>cell phone?  Get a new here for FREE!
>>https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
>>_______________________________________________
>>Jboss-development mailing list
>>[EMAIL PROTECTED]
>>https://lists.sourceforge.net/lists/listinfo/jboss-development
>>
> 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development

-- 
Igor Fedorenko
Think smart. Think automated. Think Dynamics.
www.thinkdynamics.com
Index: XAResourceTest.java
===================================================================
RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jca/tm/XAResourceTest.java,v
retrieving revision 1.1
diff -u -r1.1 XAResourceTest.java
--- XAResourceTest.java 20 Aug 2002 04:59:49 -0000      1.1
+++ XAResourceTest.java 22 Sep 2002 02:45:41 -0000
@@ -168,7 +168,7 @@
       {
          ManagedConnection mc = h.getManagedConnection();
          XAResource xares = mc.getXAResource();
-         Xid xid = createXid();
+         Xid xid = createBranchXid();
          xares.start(xid, XAResource.TMNOFLAGS);
          Object stuff = h.doStuff(mc, toString(xid));
          xares.end(xid, XAResource.TMSUCCESS);
@@ -198,7 +198,7 @@
       {
          ManagedConnection mc = h.getManagedConnection();
          XAResource xares = mc.getXAResource();
-         Xid xid = createXid();
+         Xid xid = createBranchXid();
          xares.start(xid, XAResource.TMNOFLAGS);
          Object stuff = h.doStuff(mc, toString(xid));
          xares.end(xid, XAResource.TMSUCCESS);
@@ -288,8 +288,8 @@
          ManagedConnection mc = h.getManagedConnection();
          XAResource xares = mc.getXAResource();
 
-         Xid xid1 = createXid();
-         Xid xid2 = createXid();
+         Xid xid1 = createBranchXid();
+         Xid xid2 = createBranchXid();
 
          // tx1
          xares.start(xid1, XAResource.TMNOFLAGS);
@@ -460,13 +460,21 @@
    protected Xid createXid()
       throws Exception
    {
-      return (Xid)getServer().invoke(xidFactory, "newXid", new Object[] {}, new 
String[] {});
+      Xid xid = (Xid)getServer().invoke(xidFactory, "newXid", new Object[] {}, new 
+String[] {});
+      return createXid(xid, 1);
    }
 
    protected Xid createXid(Xid xid, long branch)
       throws Exception
    {
       return (Xid)getServer().invoke(xidFactory, "newBranch", new Object[] {xid, new 
Long(branch)}, new String[] {javax.transaction.xa.Xid.class.getName(), "long"});
+   }
+
+   protected Xid createBranchXid()
+      throws Exception
+   {
+      final Xid xid = createXid();
+      return createXid(xid, 1);
    }
 
    private String toString(Xid xid)

Reply via email to