Atomikos Forum

Invalid XA resource and TXN not rolled back (2 JMS + 1 DB)

We have the following setup:
1 input JMS queue
Listener processes the message and stores a result in DB
then posts on an output JMS queue.

At some point the following happened:
during the commit phase, there was an XA error with the JMS component (the prepare phase was ok).
Atomikos issues the following warning:

JMS INPUT:
55981685 [Thread-2] WARN  atomikos  - XA resource 'INPUT_QUEUE_BROKER': commit for XID '33352E35342E31322E3130372E746D30303933333030313832:33352E35342E31322E3130372E746D393333' raised -4: the supplied XID is invalid for this XA resource
javax.transaction.xa.XAException: XA operation failed, see errorCode
    at com.ibm.mq.MQXAResource.commit(MQXAResource.java:356)
(...)
55981685 [Thread-2] WARN  atomikos  - XAResource.commit: invalid Xid - transaction already committed in resource?


JDBC:
55981685 [Thread-2] INFO  atomikos  - XAResource.commit ( 33352E35342E31322E3130372E746D30303933333030313832:33352E35342E31322E3130372E746D393334 , false ) on resource jdbc/standalone/DS represented by XAResource instance com.ibm.db2.jcc.t4.bc@6b266b26


JMS OUTPUT:
55981688 [Thread-2] WARN  atomikos  - XA resource 'OUTPUT_QUEUE_BROKER': commit for XID '33352E35342E31322E3130372E746D30303933333030313832:33352E35342E31322E3130372E746D393335' raised -4: the supplied XID is invalid for this XA resource
javax.transaction.xa.XAException: XA operation failed, see errorCode
    at com.ibm.mq.MQXAResource.commit(MQXAResource.java:356)
(...)
55981688 [Thread-2] WARN  atomikos  - XAResource.commit: invalid Xid - transaction already committed in resource?


The final result is that the JMS message rolls back and is handled a second time, with duplicate data in the DB.

Why does Atomikos consider that the transaction can proceed? Can this be altered through a setting? Is there anything to do in this case?


Components used:
DB2 Version 9.5 Fixpack 5
atomikos-3.7.0.
Marius Van Wyk: MQ Series Version 6.0.2.4
fdo Send private email
Friday, April 12, 2013
 
 
Looks like some MQSeries problem: if it cannot commit then why does it accept the prepare? It shouldn't IMHO.

Without further information I can't say a lot about it. We'd have to make time to look at your configuration; do you happen to have access to budget for commercial services?
Guy Pardon Send private email
Monday, May 27, 2013
 
 
We are also experiencing this problem, and our application is trying to do the exact same set of actions:

1) Pick up from a JMS queue, 2) insert into a database, 3) put to another JMS queue

The strange thing for us is that step 3 sometimes appears to be committed without steps 2 or 1.  This only seems to happen in our app under heavy load (100+ inbound messages per second) - especially when the number of message consumers is ramping up.  Any ideas as to why this might be happening?

Using:
Atomikos 3.8.0
DB2 on z/OS 10.1
MQSeries 7.0.1.7
Deploying to Tomcat 6.0.36


Here are the exceptions we're seeing:

2013-07-30 13:34:48,755 [WARN] com.atomikos.datasource.xa.XAResourceTransaction - XA resource 'primaryConnectionFactory1_MQSeries_XA_RMI': commit for XID '32616436376666662D323239302D343538312D383633302D336338653665356563616566746D31303739313030303031:32616436376666662D323239302D343538312D383633302D336338653665356563616566746D39373238' raised -4: the supplied XID is invalid for this XA resource
javax.transaction.xa.XAException: The method 'xa_commit' has failed with errorCode '-4'.
    at com.ibm.mq.jmqi.JmqiXAResource.commit(JmqiXAResource.java:407)
    at com.atomikos.datasource.xa.XAResourceTransaction.commit(XAResourceTransaction.java:799)
    at com.atomikos.icatch.imp.CommitMessage.send(CommitMessage.java:72)
    at com.atomikos.icatch.imp.PropagationMessage.submit(PropagationMessage.java:109)
    at com.atomikos.icatch.imp.Propagator$PropagatorThread.run(Propagator.java:87)
    at com.atomikos.icatch.imp.Propagator.submitPropagationMessage(Propagator.java:66)
    at com.atomikos.icatch.imp.CoordinatorStateHandler.commit(CoordinatorStateHandler.java:577)
    at com.atomikos.icatch.imp.IndoubtStateHandler.commit(IndoubtStateHandler.java:184)
    at com.atomikos.icatch.imp.CoordinatorImp.commit(CoordinatorImp.java:715)
    at com.atomikos.icatch.imp.CoordinatorImp.terminate(CoordinatorImp.java:975)
    at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:82)
    at com.atomikos.icatch.imp.CompositeTransactionImp.commit(CompositeTransactionImp.java:336)
    at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:208)
    at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:501)
    at com.atomikos.icatch.jta.UserTransactionImp.commit(UserTransactionImp.java:130)
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1010)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:257)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1059)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1051)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:948)
    at java.lang.Thread.run(Thread.java:662)
2013-07-30 13:34:48,756 [WARN] com.atomikos.datasource.xa.XAResourceTransaction - XAResource.commit: invalid Xid - transaction already committed in resource?
2013-07-30 13:34:52,416 [WARN] com.atomikos.datasource.xa.XAResourceTransaction - XA resource 'primaryConnectionFactory2_MQSeries_XA_RMI': commit for XID '32616436376666662D323239302D343538312D383633302D336338653665356563616566746D31303832393030303031:32616436376666662D323239302D343538312D383633302D336338653665356563616566746D39383932' raised -4: the supplied XID is invalid for this XA resource
javax.transaction.xa.XAException: The method 'xa_commit' has failed with errorCode '-4'.
    at com.ibm.mq.jmqi.JmqiXAResource.commit(JmqiXAResource.java:407)
    at com.atomikos.datasource.xa.XAResourceTransaction.commit(XAResourceTransaction.java:799)
    at com.atomikos.icatch.imp.CommitMessage.send(CommitMessage.java:72)
    at com.atomikos.icatch.imp.PropagationMessage.submit(PropagationMessage.java:109)
    at com.atomikos.icatch.imp.Propagator$PropagatorThread.run(Propagator.java:87)
    at com.atomikos.icatch.imp.Propagator.submitPropagationMessage(Propagator.java:66)
    at com.atomikos.icatch.imp.CoordinatorStateHandler.commit(CoordinatorStateHandler.java:577)
    at com.atomikos.icatch.imp.IndoubtStateHandler.commit(IndoubtStateHandler.java:184)
    at com.atomikos.icatch.imp.CoordinatorImp.commit(CoordinatorImp.java:715)
    at com.atomikos.icatch.imp.CoordinatorImp.terminate(CoordinatorImp.java:975)
    at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:82)
    at com.atomikos.icatch.imp.CompositeTransactionImp.commit(CompositeTransactionImp.java:336)
    at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:208)
    at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:501)
    at com.atomikos.icatch.jta.UserTransactionImp.commit(UserTransactionImp.java:130)
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1010)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:257)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1059)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1051)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:948)
    at java.lang.Thread.run(Thread.java:662)
2013-07-30 13:34:52,434 [WARN] com.atomikos.datasource.xa.XAResourceTransaction - XAResource.commit: invalid Xid - transaction already committed in resource?
2013-07-30 13:34:52,541 [WARN] com.atomikos.datasource.xa.XAResourceTransaction - XA resource 'abcDataSource': commit for XID '32616436376666662D323239302D343538312D383633302D336338653665356563616566746D31303834353030303031:32616436376666662D323239302D343538312D383633302D336338653665356563616566746D39393037' raised -4: the supplied XID is invalid for this XA resource
com.ibm.db2.jcc.am.XaException: [jcc][t4][10401][12066][4.11.88] XA exception: XAER_NOTA ERRORCODE=-4228, SQLSTATE=null
    at com.ibm.db2.jcc.am.gd.c(gd.java:453)
    at com.ibm.db2.jcc.am.gd.c(gd.java:477)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:1712)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:1587)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:237)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:205)
    at com.ibm.db2.jcc.t4.zb.commit(zb.java:165)
    at com.atomikos.datasource.xa.XAResourceTransaction.commit(XAResourceTransaction.java:799)
    at com.atomikos.icatch.imp.CommitMessage.send(CommitMessage.java:72)
    at com.atomikos.icatch.imp.PropagationMessage.submit(PropagationMessage.java:109)
    at com.atomikos.icatch.imp.Propagator$PropagatorThread.run(Propagator.java:87)
    at com.atomikos.icatch.imp.Propagator.submitPropagationMessage(Propagator.java:66)
    at com.atomikos.icatch.imp.CoordinatorStateHandler.commit(CoordinatorStateHandler.java:577)
    at com.atomikos.icatch.imp.IndoubtStateHandler.commit(IndoubtStateHandler.java:184)
    at com.atomikos.icatch.imp.CoordinatorImp.commit(CoordinatorImp.java:715)
    at com.atomikos.icatch.imp.CoordinatorImp.terminate(CoordinatorImp.java:975)
    at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:82)
    at com.atomikos.icatch.imp.CompositeTransactionImp.commit(CompositeTransactionImp.java:336)
    at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:208)
    at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:501)
    at com.atomikos.icatch.jta.UserTransactionImp.commit(UserTransactionImp.java:130)
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1010)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:257)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1059)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1051)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:948)
    at java.lang.Thread.run(Thread.java:662)
2013-07-30 13:34:52,541 [WARN] com.atomikos.datasource.xa.XAResourceTransaction - XAResource.commit: invalid Xid - transaction already committed in resource?
2013-07-30 13:34:52,542 [WARN] com.atomikos.datasource.xa.XAResourceTransaction - XA resource 'abcDataSource': commit for XID '32616436376666662D323239302D343538312D383633302D336338653665356563616566746D31303833373030303031:32616436376666662D323239302D343538312D383633302D336338653665356563616566746D39383332' raised -4: the supplied XID is invalid for this XA resource
com.ibm.db2.jcc.am.XaException: [jcc][t4][10401][12066][4.11.88] XA exception: XAER_NOTA ERRORCODE=-4228, SQLSTATE=null
    at com.ibm.db2.jcc.am.gd.c(gd.java:453)
    at com.ibm.db2.jcc.am.gd.c(gd.java:477)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:1712)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:1587)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:237)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:205)
    at com.ibm.db2.jcc.t4.zb.commit(zb.java:165)
    at com.atomikos.datasource.xa.XAResourceTransaction.commit(XAResourceTransaction.java:799)
    at com.atomikos.icatch.imp.CommitMessage.send(CommitMessage.java:72)
    at com.atomikos.icatch.imp.PropagationMessage.submit(PropagationMessage.java:109)
    at com.atomikos.icatch.imp.Propagator$PropagatorThread.run(Propagator.java:87)
    at com.atomikos.icatch.imp.Propagator.submitPropagationMessage(Propagator.java:66)
    at com.atomikos.icatch.imp.CoordinatorStateHandler.commit(CoordinatorStateHandler.java:577)
    at com.atomikos.icatch.imp.IndoubtStateHandler.commit(IndoubtStateHandler.java:184)
    at com.atomikos.icatch.imp.CoordinatorImp.commit(CoordinatorImp.java:715)
    at com.atomikos.icatch.imp.CoordinatorImp.terminate(CoordinatorImp.java:975)
    at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:82)
    at com.atomikos.icatch.imp.CompositeTransactionImp.commit(CompositeTransactionImp.java:336)
    at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:208)
    at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:501)
    at com.atomikos.icatch.jta.UserTransactionImp.commit(UserTransactionImp.java:130)
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1010)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:257)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1059)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1051)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:948)
    at java.lang.Thread.run(Thread.java:662)
2013-07-30 13:34:52,543 [WARN] com.atomikos.datasource.xa.XAResourceTransaction - XAResource.commit: invalid Xid - transaction already committed in resource?
2013-07-30 13:34:52,562 [WARN] com.atomikos.datasource.xa.XAResourceTransaction - XA resource 'abcDataSource': commit for XID '32616436376666662D323239302D343538312D383633302D336338653665356563616566746D31303738373030303031:32616436376666662D323239302D343538312D383633302D336338653665356563616566746D39393039' raised -4: the supplied XID is invalid for this XA resource
com.ibm.db2.jcc.am.XaException: [jcc][t4][10401][12066][4.11.88] XA exception: XAER_NOTA ERRORCODE=-4228, SQLSTATE=null
    at com.ibm.db2.jcc.am.gd.c(gd.java:453)
    at com.ibm.db2.jcc.am.gd.c(gd.java:477)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:1712)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:1587)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:237)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:205)
    at com.ibm.db2.jcc.t4.zb.commit(zb.java:165)
    at com.atomikos.datasource.xa.XAResourceTransaction.commit(XAResourceTransaction.java:799)
    at com.atomikos.icatch.imp.CommitMessage.send(CommitMessage.java:72)
    at com.atomikos.icatch.imp.PropagationMessage.submit(PropagationMessage.java:109)
    at com.atomikos.icatch.imp.Propagator$PropagatorThread.run(Propagator.java:87)
    at com.atomikos.icatch.imp.Propagator.submitPropagationMessage(Propagator.java:66)
    at com.atomikos.icatch.imp.CoordinatorStateHandler.commit(CoordinatorStateHandler.java:577)
    at com.atomikos.icatch.imp.IndoubtStateHandler.commit(IndoubtStateHandler.java:184)
    at com.atomikos.icatch.imp.CoordinatorImp.commit(CoordinatorImp.java:715)
    at com.atomikos.icatch.imp.CoordinatorImp.terminate(CoordinatorImp.java:975)
    at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:82)
    at com.atomikos.icatch.imp.CompositeTransactionImp.commit(CompositeTransactionImp.java:336)
    at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:208)
    at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:501)
    at com.atomikos.icatch.jta.UserTransactionImp.commit(UserTransactionImp.java:130)
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1010)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:257)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1059)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1051)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:948)
    at java.lang.Thread.run(Thread.java:662)
2013-07-30 13:34:52,562 [WARN] com.atomikos.datasource.xa.XAResourceTransaction - XAResource.commit: invalid Xid - transaction already committed in resource?
2013-07-30 13:34:52,633 [WARN] com.atomikos.datasource.xa.XAResourceTransaction - XA resource 'abcDataSource': commit for XID '32616436376666662D323239302D343538312D383633302D336338653665356563616566746D31303835353030303031:32616436376666662D323239302D343538312D383633302D336338653665356563616566746D39393334' raised -4: the supplied XID is invalid for this XA resource
com.ibm.db2.jcc.am.XaException: [jcc][t4][10401][12066][4.11.88] XA exception: XAER_NOTA ERRORCODE=-4228, SQLSTATE=null
    at com.ibm.db2.jcc.am.gd.c(gd.java:453)
    at com.ibm.db2.jcc.am.gd.c(gd.java:477)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:1712)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:1587)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:237)
    at com.ibm.db2.jcc.t4.zb.a(zb.java:205)
    at com.ibm.db2.jcc.t4.zb.commit(zb.java:165)
    at com.atomikos.datasource.xa.XAResourceTransaction.commit(XAResourceTransaction.java:799)
    at com.atomikos.icatch.imp.CommitMessage.send(CommitMessage.java:72)
    at com.atomikos.icatch.imp.PropagationMessage.submit(PropagationMessage.java:109)
    at com.atomikos.icatch.imp.Propagator$PropagatorThread.run(Propagator.java:87)
    at com.atomikos.icatch.imp.Propagator.submitPropagationMessage(Propagator.java:66)
    at com.atomikos.icatch.imp.CoordinatorStateHandler.commit(CoordinatorStateHandler.java:577)
    at com.atomikos.icatch.imp.IndoubtStateHandler.commit(IndoubtStateHandler.java:184)
    at com.atomikos.icatch.imp.CoordinatorImp.commit(CoordinatorImp.java:715)
    at com.atomikos.icatch.imp.CoordinatorImp.terminate(CoordinatorImp.java:975)
    at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:82)
    at com.atomikos.icatch.imp.CompositeTransactionImp.commit(CompositeTransactionImp.java:336)
    at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:208)
    at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:501)
    at com.atomikos.icatch.jta.UserTransactionImp.commit(UserTransactionImp.java:130)
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1010)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:257)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1059)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1051)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:948)
    at java.lang.Thread.run(Thread.java:662)
2013-07-30 13:34:52,633 [WARN] com.atomikos.datasource.xa.XAResourceTransaction - XAResource.commit: invalid Xid - transaction already committed in resource?
Will Johnson Send private email
Tuesday, July 30, 2013
 
 
Here is our Spring context:

    <bean id="atomikosUserTransactionService" class="com.atomikos.icatch.config.UserTransactionServiceImp"
          init-method="init" destroy-method="shutdownWait">
        <constructor-arg>
            <props>
                <prop key="com.atomikos.icatch.service">com.atomikos.icatch.standalone.UserTransactionServiceFactory</prop>
                <prop key="com.atomikos.icatch.threaded_2pc">false</prop>
                <prop key="com.atomikos.icatch.max_timeout">3600000</prop>
                <prop key="com.atomikos.icatch.default_jta_timeout">120000</prop>
                <prop key="com.atomikos.icatch.tm_unique_name">${jta.transactionManager.name}</prop>
                <prop key="com.atomikos.icatch.log_base_name">${jta.logFile.baseName}</prop>
                <prop key="com.atomikos.icatch.max_actives">-1</prop>
            </props>
        </constructor-arg>
    </bean>
    
    <bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp"
          depends-on="atomikosUserTransactionService">
        <property name="transactionTimeout" value="120" />
    </bean>
    
    <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager"
          init-method="init" destroy-method="close"
          depends-on="atomikosUserTransactionService, dataSource, atomikosPrimaryConnectionFactory1, atomikosPrimaryConnectionFactory2">
        <property name="startupTransactionService" value="false"/>
        <property name="forceShutdown" value="false" />
    </bean>
    
    <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"
          depends-on="atomikosUserTransactionService">
        <property name="transactionManager" ref="atomikosTransactionManager" />
        <property name="userTransaction" ref="atomikosUserTransaction" />
    </bean>
       
    <jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/abc"
        cache="true" resource-ref="true" lookup-on-startup="false"
        proxy-interface="javax.sql.DataSource" />
    
    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="persistenceUnitName" value="persistenceUnit" />
        <property name="jpaProperties">
            <props>
                <prop key="hibernate.dialect">${hibernate.dialect}</prop>
                <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
                <prop key="hibernate.default_schema">${hibernate.default_schema}</prop>
                <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
                <prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
                <prop key="hibernate.order_inserts">true</prop>
                <prop key="hibernate.order_updates">true</prop>
                <prop key="hibernate.cache.use_second_level_cache">true</prop>
                <prop key="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.EhCacheRegionFactory</prop>
                <prop key="net.sf.ehcache.configurationResourceName">/abc-ehcache.xml</prop>
                <prop key="hibernate.transaction.factory_class">org.hibernate.ejb.transaction.JoinableCMTTransactionFactory</prop>
                <prop key="hibernate.transaction.manager_lookup_class">com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup</prop>
            </props>
        </property>
    </bean>
    
    <tx:annotation-driven transaction-manager="transactionManager" />

    <jee:jndi-lookup id="primaryConnectionFactory1" jndi-name="java:comp/env/jms/primaryConnectionFactory1" />
    <jee:jndi-lookup id="primaryConnectionFactory2" jndi-name="java:comp/env/jms/primaryConnectionFactory2" />
    
    <bean id="atomikosPrimaryConnectionFactoryCommon" class="com.atomikos.jms.AtomikosConnectionFactoryBean"
          init-method="init" destroy-method="close" abstract="true">
        <property name="localTransactionMode" value="false" />
        <property name="maxPoolSize" value="80" />
    </bean>
    <bean id="atomikosPrimaryConnectionFactory1" parent="atomikosPrimaryConnectionFactoryCommon">
        <property name="xaConnectionFactory" ref="primaryConnectionFactory1" />
        <property name="uniqueResourceName" value="primaryConnectionFactory1_MQSeries_XA_RMI"/>
    </bean>
    <bean id="atomikosPrimaryConnectionFactory2" parent="atomikosPrimaryConnectionFactoryCommon">
        <property name="xaConnectionFactory" ref="primaryConnectionFactory2" />
        <property name="uniqueResourceName" value="primaryConnectionFactory2_MQSeries_XA_RMI"/>
    </bean>

    <jee:jndi-lookup id="inboundXmlQueue" jndi-name="java:comp/env/jms/inboundXmlQueue" />

    <bean id="inboundXmlMessageDrivenContainerCommon" class="org.springframework.jms.listener.DefaultMessageListenerContainer"
          init-method="initialize" destroy-method="shutdown" abstract="true">
        <property name="destination" ref="inboundXmlQueue"/>
        <property name="messageListener" ref="inboundXmlMessageListener" />
        <property name="maxConcurrentConsumers" value="40" />
        <property name="sessionTransacted" value="true" />
        <property name="transactionManager" ref="transactionManager" />
        <property name="receiveTimeout" value="30000" />
        <property name="transactionTimeout" value="120" />
        <property name="cacheLevelName" value="CACHE_CONSUMER" />
    </bean>
    <bean id="inboundXmlMessageDrivenContainer1" parent="inboundXmlMessageDrivenContainerCommon">
        <property name="connectionFactory" ref="atomikosPrimaryConnectionFactory1" />
    </bean>
   
    <bean id="inboundXmlMessageDrivenContainer2" parent="inboundXmlMessageDrivenContainerCommon">
        <property name="connectionFactory" ref="atomikosPrimaryConnectionFactory2" />
    </bean>

    <jee:jndi-lookup id="xxxRequestQueue" jndi-name="java:comp/env/jms/xxxRequestQueue" />

    <bean id="primaryJmsTemplate1" class="com.atomikos.jms.extra.ConcurrentJmsSenderTemplate">
        <property name="atomikosConnectionFactoryBean" ref="atomikosPrimaryConnectionFactory1" />
        <property name="destination" ref="xxxRequestQueue" />
    </bean>
    <bean id="primaryJmsTemplate2" class="com.atomikos.jms.extra.ConcurrentJmsSenderTemplate">
        <property name="atomikosConnectionFactoryBean" ref="atomikosPrimaryConnectionFactory2" />
        <property name="destination" ref="xxxRequestQueue" />
    </bean>


Here is our Tomcat context:

    <Resource name="jdbc/abc"
        uniqueResourceName="abcDataSource"
        auth="Container"
        type="com.atomikos.jdbc.AtomikosDataSourceBean"
        factory="com.atomikos.tomcat.BeanFactory"
        minPoolSize="0"
        maxPoolSize="35"
        maxIdleTime="15"
        maintenanceInterval="15"
        defaultIsolationLevel="2"
        testQuery="SELECT 1 FROM SYSIBM.SYSDUMMY1"
        xaDataSourceClassName="com.ibm.db2.jcc.DB2XADataSource"
        xaProperties.serverName=""
        xaProperties.portNumber=""
        xaProperties.databaseName=""
        xaProperties.user=""
        xaProperties.password=""
        xaProperties.currentSchema=""
        xaProperties.driverType="4" />

    <Resource name="jms/primaryConnectionFactory1"
        auth="Container"
        factory="com.ibm.mq.jms.MQXAQueueConnectionFactoryFactory"
        type="com.ibm.mq.jms.MQXAQueueConnectionFactory"
        CHAN="" HOST="" PORT="" QMGR="" TRAN="1" />

    <Resource name="jms/primaryConnectionFactory2"
        auth="Container"
        factory="com.ibm.mq.jms.MQXAQueueConnectionFactoryFactory"
        type="com.ibm.mq.jms.MQXAQueueConnectionFactory"
        CHAN="" HOST="" PORT="" QMGR="" TRAN="1" />

    <Resource name="jms/inboundXmlQueue"
        auth="Container"
        factory="com.ibm.mq.jms.MQQueueFactory"
        type="com.ibm.mq.jms.MQQueue"
        QU="" />

    <Resource name="jms/xxxRequestQueue"
        auth="Container"
        factory="com.ibm.mq.jms.MQQueueFactory"
        type="com.ibm.mq.jms.MQQueue"
        QU="" TC="1" />
Will Johnson Send private email
Tuesday, July 30, 2013
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics