I am trying to get Transactions working in the following scenario:
SSB (with CMT) --> POJO (Injected with JMSTtemplate) --> Sends JMS Msg
I have looked up the XA connection factory from weblogic and injected the JMS template with it. I expect the JMS message to be put on the queue only when i commit in the SSB. When i setRollbackonly to true in the SSB, i expect the JMS message not to be put on the queue. However that doesnt seem to happen. The message is put on the queue even when i rollback in the SSB.
How do i get Spring to participate in the Transaction from the SSB?
Here is the configuration:
Code:ejb-jar.xml <enterprise-beans> <session> <display-name>PMSimulator</display-name> <ejb-name>PMSimulator</ejb-name> <home>com.abc.xyz.pmsimulator.PMSimulatorHome</home> <remote>com.abc.xyz.pmsimulator.PMSimulatorRemote</remote> <ejb-class>com.abc.xyz.pmsimulator.PMSimulatorBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> <resource-ref> <res-ref-name>jms/mqwmcappqm1xaqcf</res-ref-name> <res-type>javax.jms.QueueConnectionFactory</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> <resource-env-ref> <resource-env-ref-name> jms/pm.submission.to.tg</resource-env-ref-name> <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type> </resource-env-ref> </session> </enterprise-beans> <assembly-descriptor> <container-transaction> <method> <ejb-name>PMSimulator</ejb-name> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> </assembly-descriptor> Weblogic-ejb-jar.xml <weblogic-enterprise-bean> <ejb-name>PMSimulator</ejb-name> <transaction-descriptor> <trans-timeout-seconds>3600</trans-timeout-seconds> </transaction-descriptor> <reference-descriptor> <resource-description> <res-ref-name>jms/mqwmcappqm1xaqcf</res-ref-name> <jndi-name>mqwmcappqm1xaqcf</jndi-name> </resource-description> <resource-env-description> <res-env-ref-name> jms/pm.submission.to.tg</res-env-ref-name> <jndi-name>pm.submission.to.tg</jndi-name> </resource-env-description> </reference-descriptor> <enable-call-by-reference>true</enable-call-by-reference> <jndi-name>PMSimulator</jndi-name> </weblogic-enterprise-bean> Spring Context <!-- Define XA Connection Factory --> <bean id="common.messaging.XAConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="true"> <property name="jndiName" value="mqwmcappqm1xaqcf"/> </bean> <!-- Define Transaction Manager --> <bean id="transactionManager" class="org.springframework.transaction.jta.WebLogicJtaTransactionManager" lazy-init="true"> </bean> <!-- Enlist Transactional Resources --> <bean id="TransactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" lazy-init="true"> <property name="transactionManager"> <ref bean="transactionManager"/> </property> <property name="transactionAttributes"> <props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean>


Reply With Quote