1 Reply Latest reply on Aug 22, 2014 5:01 AM by hchiorean

    Should XA really work?

    nl

      Hi all,

       

      I'm trying to configure MS and infinispan for XA transaction support, but I fail.

      Env: MS 3.8.0, Infinispan 5.2.10, EAP5

       

      What I get is:

      {noformat}

      java.lang.NullPointerException

          at org.infinispan.transaction.xa.TransactionXaAdapter.start(TransactionXaAdapter.java:147)

          at org.modeshape.jcr.JcrXaSession.start(JcrXaSession.java:59)

      {noformat}

       

      Debugging the code I see that

      JcrXaSession.start() is delegating the call to repository.documentStore().xaResource(). DocumentStore is in my case a LocalDocumentStore which in turn delegates to localCache().getAdvancedCache() the which results in a org.infinispan.CacheImpl:

       

      {code}

      @Override

         public XAResource getXAResource() {

            return new TransactionXaAdapter(txTable, recoveryManager, txCoordinator, commandsFactory, rpcManager, null, config, name);

         }

      {code}

       

      Now this contructor explicitly set the localTransactio to null.

      But that one is required in org.inifispan.transaction.xa.TransactionXaAdapter.start():

       

      {code}

      @Override

         public void start(Xid externalXid, int i) throws XAException {

            Xid xid = convertXid(externalXid);

            //transform in our internal format in order to be able to serialize

            localTransaction.setXid(xid);

            txTable.addLocalTransactionMapping(localTransaction);

            if (trace) log.tracef("start called on tx %s", this.localTransaction.getGlobalTransaction());

         }

      {code}

       

      How should this work in any way?

       

      Thanks for any help,

      Niels