You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by anupamsen <an...@yahoo.com> on 2012/09/11 09:08:24 UTC

Re: some routing error in XA transaction

I too faced the same issue, was puzzled a lot. In my case I was having 2
transaction managers, 1 was for JpaTransactionManager for hibernate usage
for database operations and I wanted another transaction manager for
JmsTransactionManager. I am not sure why this is thrown.

Though I tweaked some of the configuration and defined the following-
  <jee:jndi-lookup id="XlConnectionFactory"
jndi-name="QueueConnectionFactory">
    <jee:environment>
      java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
      java.naming.provider.url=t3://localhost:8001
    </jee:environment>
  </jee:jndi-lookup>
  
  
  <bean id="txManager"
class="org.springframework.jms.connection.JmsTransactionManager">
      <property name="connectionFactory" ref="XlConnectionFactory"/>
  </bean>
  
  <bean id="PROPAGATION_REQUIRED"
class="org.apache.camel.spring.spi.SpringTransactionPolicy">
    <property name="transactionManager" ref="txManager"/>
    *<property name="propagationBehaviorName"
value="PROPAGATION_REQUIRED"/>*
  </bean>
  
  
  <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory" ref="XlConnectionFactory"/>
    *<property name="transacted"  value="true"/>*
    <property name="transactionManager" ref="txManager"/>
  </bean>

The route was later configured below -

    <route id="saveCommodityRoute"
errorHandlerRef="DLCErrorHandler-SaveCommodity">
      <from
uri="jms:queue:XL-JMS-Server/saveCommodity?concurrentConsumers=3" />
      *<camel:transacted ref="PROPAGATION_REQUIRED"/>*

This solved the issue. Hope this helps.



--
View this message in context: http://camel.465427.n5.nabble.com/some-routing-error-in-XA-transaction-tp5714417p5719080.html
Sent from the Camel - Users mailing list archive at Nabble.com.