[jboss-user] [IronJacamar] - Can the JBoss JCA support multiple XAResources?

ShuiXin Zhang do-not-reply at jboss.com
Thu Jul 12 04:13:42 EDT 2012

ShuiXin Zhang [https://community.jboss.org/people/utiao] created the discussion

"Can the JBoss JCA support multiple XAResources?"

To view the discussion, visit: https://community.jboss.org/message/747682#747682

Hi all,
I have a connector based on JCA. I am confused on the inflow transaction issue.
I construct a XID and submit the work to work manager. The work will access the same database twice, and they will use 2 XAResources. I configured that all XAResource are not belong to same RM.
The first XAResource can work fine, but the second XAResource will *use the same XID* to start, it is failed.

I noticed that the TransactionImple will use com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.jca.TransactionImple, its createXid method will use the below code, it will use the old one.

I want to confirm that JCA subordinator can only include one XAResource? If it is no, how can I do it?

    private final Xid createXid(boolean branch, XAModifier theModifier)
        Xid xid = baseXid();
        if (xid != null)
            return xid;
        xid = new XidImple(_theTransaction, branch);
        if (theModifier != null)
                xid = theModifier.createXid((XidImple) xid);
            catch (Exception e)
        return xid;

public final Xid baseXid ()
    return ((SubordinateAtomicAction) _theTransaction).getXid();

It's my start transaction code snippet.

ResourceAdapterImpl ra = (ResourceAdapterImpl)notifier_.getResourceAdapter();
BootstrapContext ctx = ra.getContext();
Xid xid = getXid(tid);
WorkManager workMgr = ctx.getWorkManager();
ExecutionContext ectx = new ExecutionContext();
MyWork work = new MyWork(this, events);
workMgr.doWork(work, WorkManager.INDEFINITE, ectx, work);

I use JBossTS 4.2.3 SP5 C09.

Reply to this message by going to Community

Start a new discussion in IronJacamar at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120712/05334603/attachment.html 

More information about the jboss-user mailing list