Atomikos Forum |
|
hi,
I'm using atomikos to deal with transaction between JMS and JDBC.I put 1000 messages to a queue of IBM WebSphere MQ and receive these messages to a oracel DB,I test my application in these two cases: a).start my application to receive messages from the queue.stop the queue manager before all messages are consumed. b).start my application to receive messages from the queue.stop my application before all messages are consumed. after sereval tests,i found the the transcation is successed in case a,the sum number in the queue and DB is 1000;but the case b failed. the sum number in the queue and DB is less than 1000. Thanks for your help!
bellow is my spring config file
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate"> <property name="environment"> <props> <prop key="java.naming.factory.initial"> com.sun.jndi.fscontext.RefFSContextFactory </prop> <prop key="java.naming.provider.url"> file:/d:/auident/config/c2int/94 </prop> </props> </property> </bean> <bean id="queueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiTemplate"> <ref bean="jndiTemplate" /> </property> <property name="jndiName"> <value>QM_feed_000</value> </property> </bean> <bean id="des" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiTemplate"> <ref local="jndiTemplate" /> </property> <property name="resourceRef"> <value>false</value> </property> <property name="jndiName"> <value>MQSendQueue</value> </property> </bean>
<bean id="dataSource" class="com.atomikos.jdbc.SimpleDataSourceBean"
init-method="init" destroy-method="close"> <property name="uniqueResourceName"> <value>oracle</value> </property> <property name="xaDataSourceClassName"> <value>oracle.jdbc.xa.client.OracleXADataSource</value> </property> <property name="xaDataSourceProperties"> <value>user=auident;password=auident;URL=jdbc:oracle:thin:@10.0.24.94:1521:identdb</value> </property> <property name="exclusiveConnectionMode"> <value>true</value> </property> <property name="connectionPoolSize" value="3" /> </bean> <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close"> <property name="forceShutdown"> <value>false</value> </property> </bean> <bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp"> <property name="transactionTimeout" value="300" /> </bean> <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="transactionManager"> <ref bean="atomikosTransactionManager" /> </property> <property name="userTransaction"> <ref bean="atomikosUserTransaction" /> </property> </bean>
<bean id="hhtBarDataListenerContainer"
class="org.springframework.jms.listener.DefaultMessageListenerContainer"> <property name="connectionFactory"> <ref local="queueConnectionFactory" /> </property> <property name="destination"> <ref local="des" /> </property> <property name="messageListener"> <ref local="hhtBarDataMessageListener" /> </property> <property name="transactionManager"> <ref local="transactionManager" /> </property> <property name="concurrentConsumers" value="8" /> <property name="receiveTimeout" value="5000" /> <property name="recoveryInterval" value="6000" /> <property name="sessionTransacted" value="true" /> </bean> <bean id=" hhtBarDataMessageListener " class="com.sf.sap.servicegateway.hhtbardata.message. HhtBarDataMessageListener "> <property name="hhtBarDataService"> <bean class="com.sf.sap.servicegateway.hhtbardata.service.HhtBarDataServiceImpl"> <property name="hhtBarDataDataConverter"> <bean class="com.sf.sap.servicegateway.hhtbardata.service.HhtBarDataConverter" /> </property> </bean> </property> </bean> <bean id="queue4InpDaoImpl" class="com.sf.sap.servicegateway.hhtbardata.dao.Queue4InpJdbcDaoImpl"> <property name="dataSource"> <ref bean="dataSource" /> </property> </bean> </beans> Thanks for your help! |