You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Caa_man <ca...@acs-it.ru> on 2012/09/13 14:59:20 UTC

Distributed transaction in camel route

Hello!

I`d like to built a camel route with this logic:

  - receive message with XML from WebSphere queue (camel "from")
  - begin transaction (distributed transaction via "transacted")
  - parse xml (camel "process")
  - save income message to Oracle DB (camel "process")
  - create reply message (camel "process")
  - send reply message to WebSphere queue (camel "to" with
uri="bean:mqRemoteSender?method=remoteRoute", where I manually send
camel-message body to MQQueue object)

i.e. I`d like to do "INSERT" request to DB and send message in single
transaction.

I use:

1) JmsComponent:
  <bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
        <property name="connectionFactory" ref="wmqConnectionFactory"/>
        <property name="concurrentConsumers" value="5"/>
        <property name="maxConcurrentConsumers" value="5"/>
        <property name="transactionManager" ref="transactionManager"/>
        <property name="transacted" value="true"/>
  </bean>
  <bean id="wmqConnectionFactory"
class="com.ibm.mq.jms.MQConnectionFactory">
        <property name="transportType" value="1"/>
        <property name="hostName" value="${HostName}"/>
        <property name="port">
             <bean id="portValue" class="java.lang.Integer">
                 <constructor-arg value="${PortValue}"/>
             </bean>
        </property>
        <property name="queueManager" value="${ManagerName}"/>
        <property name="channel" value="${ConnectionChannel}"/>
  </bean>
2) Transaction policy:
   <bean id="required"
class="org.apache.camel.spring.spi.SpringTransactionPolicy">
        <property name="transactionManager" ref="transactionManager"/>
        <property name="propagationBehaviorName"
value="PROPAGATION_REQUIRED"/>
   </bean>
3)  Transaction manager:
    <bean id="transactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager"/>
4)  Annotation driver:
   <tx:annotation-driven transaction-manager="transactionManager" />
5) Process with DB save requests:

    private org.springframework.orm.jpa.JpaTemplate jtaTemplate;

    @Transactional(propagation = Propagation.REQUIRED)
    @Override
    public void process(Exchange exchange) throws Exception {
      SomeEntityClass entityObject = new SomeEntityClass();
     ...
      jtaTemplate.persist(entityObject);
      jtaTemplate.flush();
   }
6) persistence-unit:
	<persistence-unit name="jpaName" transaction-type="JTA">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <jta-data-source>jdbc/applicationConnection</jta-data-source>
        <mapping-file>META-INF/orm.xml</mapping-file>
		<class>SomeEntityClass</class>
		<properties>
			<property name="eclipselink.target-server" value="OC4J" />
			<property name="eclipselink.target-database" value="Oracle" />
			<property name="eclipselink.weaving" value="false" />
			<property name="eclipselink.logging.level" value="FINE" />
			<property name="eclipselink.cache.shared.default" value="false"/>
            <property name="eclipselink.jdbc.batch-writing"
value="Oracle-JDBC" />
            <property name="eclipselink.jdbc.fetch-size" value="1000" />
		</properties>
	</persistence-unit>

But there is no distributed transaction. 
Oracle-db-transaction and wmq-send-transaction are independent from
jms-receive-transaction.
Whats wrong?



--
View this message in context: http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Distributed transaction in camel route

Posted by James Carman <ja...@carmanconsulting.com>.
So, when using Geronimo, why do you set transacted=false on your JMS
component, but yet give it a TransactionManager reference?


On Thu, Sep 13, 2012 at 6:11 PM, Christian Müller
<ch...@gmail.com> wrote:
> May be these examples are useful for you:
> https://github.com/muellerc/camel-in-transaction
>
> Best,
> Christian
>
> On Thu, Sep 13, 2012 at 4:33 PM, James Carman <ja...@carmanconsulting.com>wrote:
>
>> Claus,
>>
>> Is there any guidance on how to set up XA correctly?  We're having a
>> really rough time getting Websphere MQ and SQL Server connections to
>> work together in an XA fashion.
>>
>> Thanks,
>>
>> james
>>
>> On Thu, Sep 13, 2012 at 10:17 AM, Claus Ibsen <cl...@gmail.com>
>> wrote:
>> > For that you would need XA when you have 2+ resources participating in
>> > the same transaction.
>> > It can be tricky to setup. You would need to use the JTA transaction
>> > manager from WebSphere etc which supports XA.
>> >
>> > Make sure the MQ connection factory you refer to is the XA one.
>> >
>> > On Thu, Sep 13, 2012 at 2:59 PM, Caa_man <ca...@acs-it.ru> wrote:
>> >> Hello!
>> >>
>> >> I`d like to built a camel route with this logic:
>> >>
>> >>   - receive message with XML from WebSphere queue (camel "from")
>> >>   - begin transaction (distributed transaction via "transacted")
>> >>   - parse xml (camel "process")
>> >>   - save income message to Oracle DB (camel "process")
>> >>   - create reply message (camel "process")
>> >>   - send reply message to WebSphere queue (camel "to" with
>> >> uri="bean:mqRemoteSender?method=remoteRoute", where I manually send
>> >> camel-message body to MQQueue object)
>> >>
>> >> i.e. I`d like to do "INSERT" request to DB and send message in single
>> >> transaction.
>> >>
>> >> I use:
>> >>
>> >> 1) JmsComponent:
>> >>   <bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
>> >>         <property name="connectionFactory" ref="wmqConnectionFactory"/>
>> >>         <property name="concurrentConsumers" value="5"/>
>> >>         <property name="maxConcurrentConsumers" value="5"/>
>> >>         <property name="transactionManager" ref="transactionManager"/>
>> >>         <property name="transacted" value="true"/>
>> >>   </bean>
>> >>   <bean id="wmqConnectionFactory"
>> >> class="com.ibm.mq.jms.MQConnectionFactory">
>> >>         <property name="transportType" value="1"/>
>> >>         <property name="hostName" value="${HostName}"/>
>> >>         <property name="port">
>> >>              <bean id="portValue" class="java.lang.Integer">
>> >>                  <constructor-arg value="${PortValue}"/>
>> >>              </bean>
>> >>         </property>
>> >>         <property name="queueManager" value="${ManagerName}"/>
>> >>         <property name="channel" value="${ConnectionChannel}"/>
>> >>   </bean>
>> >> 2) Transaction policy:
>> >>    <bean id="required"
>> >> class="org.apache.camel.spring.spi.SpringTransactionPolicy">
>> >>         <property name="transactionManager" ref="transactionManager"/>
>> >>         <property name="propagationBehaviorName"
>> >> value="PROPAGATION_REQUIRED"/>
>> >>    </bean>
>> >> 3)  Transaction manager:
>> >>     <bean id="transactionManager"
>> >> class="org.springframework.transaction.jta.JtaTransactionManager"/>
>> >> 4)  Annotation driver:
>> >>    <tx:annotation-driven transaction-manager="transactionManager" />
>> >> 5) Process with DB save requests:
>> >>
>> >>     private org.springframework.orm.jpa.JpaTemplate jtaTemplate;
>> >>
>> >>     @Transactional(propagation = Propagation.REQUIRED)
>> >>     @Override
>> >>     public void process(Exchange exchange) throws Exception {
>> >>       SomeEntityClass entityObject = new SomeEntityClass();
>> >>      ...
>> >>       jtaTemplate.persist(entityObject);
>> >>       jtaTemplate.flush();
>> >>    }
>> >> 6) persistence-unit:
>> >>         <persistence-unit name="jpaName" transaction-type="JTA">
>> >>
>> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
>> >>         <jta-data-source>jdbc/applicationConnection</jta-data-source>
>> >>         <mapping-file>META-INF/orm.xml</mapping-file>
>> >>                 <class>SomeEntityClass</class>
>> >>                 <properties>
>> >>                         <property name="eclipselink.target-server"
>> value="OC4J" />
>> >>                         <property name="eclipselink.target-database"
>> value="Oracle" />
>> >>                         <property name="eclipselink.weaving"
>> value="false" />
>> >>                         <property name="eclipselink.logging.level"
>> value="FINE" />
>> >>                         <property
>> name="eclipselink.cache.shared.default" value="false"/>
>> >>             <property name="eclipselink.jdbc.batch-writing"
>> >> value="Oracle-JDBC" />
>> >>             <property name="eclipselink.jdbc.fetch-size" value="1000" />
>> >>                 </properties>
>> >>         </persistence-unit>
>> >>
>> >> But there is no distributed transaction.
>> >> Oracle-db-transaction and wmq-send-transaction are independent from
>> >> jms-receive-transaction.
>> >> Whats wrong?
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279.html
>> >> Sent from the Camel - Users mailing list archive at Nabble.com.
>> >
>> >
>> >
>> > --
>> > Claus Ibsen
>> > -----------------
>> > FuseSource
>> > Email: cibsen@fusesource.com
>> > Web: http://fusesource.com
>> > Twitter: davsclaus, fusenews
>> > Blog: http://davsclaus.com
>> > Author of Camel in Action: http://www.manning.com/ibsen
>>
>
>
>
> --

Re: Distributed transaction in camel route

Posted by Christian Müller <ch...@gmail.com>.
I updated my sample project with a new sample test for "compensation
transaction":

https://github.com/muellerc/camel-in-transaction/blob/master/src/test/java/org/apache/cmueller/camel/samples/camelone/tx/JmsAndJdbcCompensationTransactionSampleTest.java
https://github.com/muellerc/camel-in-transaction/blob/master/src/test/resources/META-INF/spring/JmsAndJdbcCompensationTransactionSampleTest-context.xml

Best,
Christian

On Mon, Sep 17, 2012 at 7:49 PM, Christian Müller <
christian.mueller@gmail.com> wrote:

> Add an additional test where the SQLExceptions happens after the second
> update.
>
> Best,
> Christian
>
>
> On Mon, Sep 17, 2012 at 4:29 AM, James Carman <ja...@carmanconsulting.com>wrote:
>
>> Something like this:
>>
>>
>> https://github.com/jwcarman/camel-in-transaction/blob/master/src/test/java/org/apache/cmueller/camel/samples/camelone/quasi/JmsAndJdbcQuasiTransactionSampleTest.java
>>
>>
>>
>> On Sun, Sep 16, 2012 at 12:53 PM, Raul Kripalani <ra...@evosent.com>
>> wrote:
>> > Hi James,
>> >
>> > By using singular transactions rather than distributed transactions
>> (XA),
>> > each resource involved is responsible for managing its own transaction,
>> i.e.
>> > the JMS session and the JDBC DataSource will run separate transactions.
>> >
>> > Camel has a concept called "Unit of Work" that is used to synchronise
>> > transactions, or quasi-transactional behaviour, across several
>> endpoints in
>> > a route. An example of a "quasi-transactional" action is found in the
>> File
>> > consumer endpoint, where the file only will be moved to the "done"
>> directory
>> > if the route hasn't failed. Otherwise it will be moved to the "failed"
>> > directory.
>> >
>> > In the scenario that Christian proposes, the JMS consumer will begin a
>> > transaction and will wait till the Exchange is done. At that point, it
>> will
>> > decide whether to commit or rollback the transaction depending on if
>> there's
>> > an Exception set or not in the Exchange. This way, you don't get full XA
>> > behaviour, but you get something pretty close. There's still a risk of
>> JMS
>> > and JDBC becoming falling out of sync if Camel crashes after JDBC
>> commits
>> > but before the JMS endpoint is notified of the DONE exchange and
>> commits the
>> > local transaction there.
>> >
>> > To use this approach, you want to set transacted=true at the JMS
>> consumer,
>> > so that the JMS endpoint will manage its transaction.
>> >
>> > On the other hand, XA is a different story. With XA, you don't want
>> Camel to
>> > manage the transaction (you set transacted=false on the endpoint),
>> because
>> > the XAResource will enlist itself in the transaction automatically. If
>> you
>> > set transacted=true with XA, you'll begin to see exceptions due to the
>> JMS
>> > XAResouce being enlisted twice.
>> >
>> > While I worked at FuseSource, Charles Moulliard and I created examples
>> > showing both:
>> > a) XA Transactions involving JMS and JDBC
>> > b) JMS + JDBC local transactions
>> >
>> > You can find the source code here: [1] and [2]. Here is a video with the
>> > demo: [3], and the full webinar is split in two parts: [4] and [5].
>> >
>> > Hope that helps!
>> > Raúl.
>> >
>> > ---
>> > Raúl Kripalani
>> > Enterprise Architect, Program Manager, Open Source Integration
>> specialist
>> > http://about.me/raulkripalani |
>> http://www.linkedin.com/in/raulkripalani
>> > http://blog.raulkr.net | twitter: @raulvk
>> >
>> > [1] https://github.com/FuseByExample/camel-persistence-part1
>> > [2] https://github.com/FuseByExample/camel-persistence-part2
>> > [3] http://www.youtube.com/watch?v=Fj9ECUW9nxc
>> > [4]
>> >
>> http://fusesource.com/require_registration_for?url=http://streaming.progress.com/fusesource/102711_FUSE_part_1_CM/index.htm
>> > [5]
>> >
>> http://fusesource.com/require_registration_for?url=http://streaming.progress.com/fusesource/112211_FUSE_Part_2_CM/index.htm
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279p5719433.html
>> > Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
>
>
>


--

Re: Distributed transaction in camel route

Posted by James Carman <ja...@carmanconsulting.com>.
Done.

On Mon, Sep 17, 2012 at 1:49 PM, Christian Müller
<ch...@gmail.com> wrote:
> Add an additional test where the SQLExceptions happens after the second
> update.
>
> Best,
> Christian
>
> On Mon, Sep 17, 2012 at 4:29 AM, James Carman <ja...@carmanconsulting.com>wrote:
>
>> Something like this:
>>
>>
>> https://github.com/jwcarman/camel-in-transaction/blob/master/src/test/java/org/apache/cmueller/camel/samples/camelone/quasi/JmsAndJdbcQuasiTransactionSampleTest.java
>>
>>
>>
>> On Sun, Sep 16, 2012 at 12:53 PM, Raul Kripalani <ra...@evosent.com> wrote:
>> > Hi James,
>> >
>> > By using singular transactions rather than distributed transactions (XA),
>> > each resource involved is responsible for managing its own transaction,
>> i.e.
>> > the JMS session and the JDBC DataSource will run separate transactions.
>> >
>> > Camel has a concept called "Unit of Work" that is used to synchronise
>> > transactions, or quasi-transactional behaviour, across several endpoints
>> in
>> > a route. An example of a "quasi-transactional" action is found in the
>> File
>> > consumer endpoint, where the file only will be moved to the "done"
>> directory
>> > if the route hasn't failed. Otherwise it will be moved to the "failed"
>> > directory.
>> >
>> > In the scenario that Christian proposes, the JMS consumer will begin a
>> > transaction and will wait till the Exchange is done. At that point, it
>> will
>> > decide whether to commit or rollback the transaction depending on if
>> there's
>> > an Exception set or not in the Exchange. This way, you don't get full XA
>> > behaviour, but you get something pretty close. There's still a risk of
>> JMS
>> > and JDBC becoming falling out of sync if Camel crashes after JDBC commits
>> > but before the JMS endpoint is notified of the DONE exchange and commits
>> the
>> > local transaction there.
>> >
>> > To use this approach, you want to set transacted=true at the JMS
>> consumer,
>> > so that the JMS endpoint will manage its transaction.
>> >
>> > On the other hand, XA is a different story. With XA, you don't want
>> Camel to
>> > manage the transaction (you set transacted=false on the endpoint),
>> because
>> > the XAResource will enlist itself in the transaction automatically. If
>> you
>> > set transacted=true with XA, you'll begin to see exceptions due to the
>> JMS
>> > XAResouce being enlisted twice.
>> >
>> > While I worked at FuseSource, Charles Moulliard and I created examples
>> > showing both:
>> > a) XA Transactions involving JMS and JDBC
>> > b) JMS + JDBC local transactions
>> >
>> > You can find the source code here: [1] and [2]. Here is a video with the
>> > demo: [3], and the full webinar is split in two parts: [4] and [5].
>> >
>> > Hope that helps!
>> > Raúl.
>> >
>> > ---
>> > Raúl Kripalani
>> > Enterprise Architect, Program Manager, Open Source Integration specialist
>> > http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
>> > http://blog.raulkr.net | twitter: @raulvk
>> >
>> > [1] https://github.com/FuseByExample/camel-persistence-part1
>> > [2] https://github.com/FuseByExample/camel-persistence-part2
>> > [3] http://www.youtube.com/watch?v=Fj9ECUW9nxc
>> > [4]
>> >
>> http://fusesource.com/require_registration_for?url=http://streaming.progress.com/fusesource/102711_FUSE_part_1_CM/index.htm
>> > [5]
>> >
>> http://fusesource.com/require_registration_for?url=http://streaming.progress.com/fusesource/112211_FUSE_Part_2_CM/index.htm
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279p5719433.html
>> > Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --

Re: Distributed transaction in camel route

Posted by Christian Müller <ch...@gmail.com>.
Add an additional test where the SQLExceptions happens after the second
update.

Best,
Christian

On Mon, Sep 17, 2012 at 4:29 AM, James Carman <ja...@carmanconsulting.com>wrote:

> Something like this:
>
>
> https://github.com/jwcarman/camel-in-transaction/blob/master/src/test/java/org/apache/cmueller/camel/samples/camelone/quasi/JmsAndJdbcQuasiTransactionSampleTest.java
>
>
>
> On Sun, Sep 16, 2012 at 12:53 PM, Raul Kripalani <ra...@evosent.com> wrote:
> > Hi James,
> >
> > By using singular transactions rather than distributed transactions (XA),
> > each resource involved is responsible for managing its own transaction,
> i.e.
> > the JMS session and the JDBC DataSource will run separate transactions.
> >
> > Camel has a concept called "Unit of Work" that is used to synchronise
> > transactions, or quasi-transactional behaviour, across several endpoints
> in
> > a route. An example of a "quasi-transactional" action is found in the
> File
> > consumer endpoint, where the file only will be moved to the "done"
> directory
> > if the route hasn't failed. Otherwise it will be moved to the "failed"
> > directory.
> >
> > In the scenario that Christian proposes, the JMS consumer will begin a
> > transaction and will wait till the Exchange is done. At that point, it
> will
> > decide whether to commit or rollback the transaction depending on if
> there's
> > an Exception set or not in the Exchange. This way, you don't get full XA
> > behaviour, but you get something pretty close. There's still a risk of
> JMS
> > and JDBC becoming falling out of sync if Camel crashes after JDBC commits
> > but before the JMS endpoint is notified of the DONE exchange and commits
> the
> > local transaction there.
> >
> > To use this approach, you want to set transacted=true at the JMS
> consumer,
> > so that the JMS endpoint will manage its transaction.
> >
> > On the other hand, XA is a different story. With XA, you don't want
> Camel to
> > manage the transaction (you set transacted=false on the endpoint),
> because
> > the XAResource will enlist itself in the transaction automatically. If
> you
> > set transacted=true with XA, you'll begin to see exceptions due to the
> JMS
> > XAResouce being enlisted twice.
> >
> > While I worked at FuseSource, Charles Moulliard and I created examples
> > showing both:
> > a) XA Transactions involving JMS and JDBC
> > b) JMS + JDBC local transactions
> >
> > You can find the source code here: [1] and [2]. Here is a video with the
> > demo: [3], and the full webinar is split in two parts: [4] and [5].
> >
> > Hope that helps!
> > Raúl.
> >
> > ---
> > Raúl Kripalani
> > Enterprise Architect, Program Manager, Open Source Integration specialist
> > http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> > http://blog.raulkr.net | twitter: @raulvk
> >
> > [1] https://github.com/FuseByExample/camel-persistence-part1
> > [2] https://github.com/FuseByExample/camel-persistence-part2
> > [3] http://www.youtube.com/watch?v=Fj9ECUW9nxc
> > [4]
> >
> http://fusesource.com/require_registration_for?url=http://streaming.progress.com/fusesource/102711_FUSE_part_1_CM/index.htm
> > [5]
> >
> http://fusesource.com/require_registration_for?url=http://streaming.progress.com/fusesource/112211_FUSE_Part_2_CM/index.htm
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279p5719433.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>



--

Re: Distributed transaction in camel route

Posted by James Carman <ja...@carmanconsulting.com>.
Something like this:

https://github.com/jwcarman/camel-in-transaction/blob/master/src/test/java/org/apache/cmueller/camel/samples/camelone/quasi/JmsAndJdbcQuasiTransactionSampleTest.java



On Sun, Sep 16, 2012 at 12:53 PM, Raul Kripalani <ra...@evosent.com> wrote:
> Hi James,
>
> By using singular transactions rather than distributed transactions (XA),
> each resource involved is responsible for managing its own transaction, i.e.
> the JMS session and the JDBC DataSource will run separate transactions.
>
> Camel has a concept called "Unit of Work" that is used to synchronise
> transactions, or quasi-transactional behaviour, across several endpoints in
> a route. An example of a "quasi-transactional" action is found in the File
> consumer endpoint, where the file only will be moved to the "done" directory
> if the route hasn't failed. Otherwise it will be moved to the "failed"
> directory.
>
> In the scenario that Christian proposes, the JMS consumer will begin a
> transaction and will wait till the Exchange is done. At that point, it will
> decide whether to commit or rollback the transaction depending on if there's
> an Exception set or not in the Exchange. This way, you don't get full XA
> behaviour, but you get something pretty close. There's still a risk of JMS
> and JDBC becoming falling out of sync if Camel crashes after JDBC commits
> but before the JMS endpoint is notified of the DONE exchange and commits the
> local transaction there.
>
> To use this approach, you want to set transacted=true at the JMS consumer,
> so that the JMS endpoint will manage its transaction.
>
> On the other hand, XA is a different story. With XA, you don't want Camel to
> manage the transaction (you set transacted=false on the endpoint), because
> the XAResource will enlist itself in the transaction automatically. If you
> set transacted=true with XA, you'll begin to see exceptions due to the JMS
> XAResouce being enlisted twice.
>
> While I worked at FuseSource, Charles Moulliard and I created examples
> showing both:
> a) XA Transactions involving JMS and JDBC
> b) JMS + JDBC local transactions
>
> You can find the source code here: [1] and [2]. Here is a video with the
> demo: [3], and the full webinar is split in two parts: [4] and [5].
>
> Hope that helps!
> Raúl.
>
> ---
> Raúl Kripalani
> Enterprise Architect, Program Manager, Open Source Integration specialist
> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk
>
> [1] https://github.com/FuseByExample/camel-persistence-part1
> [2] https://github.com/FuseByExample/camel-persistence-part2
> [3] http://www.youtube.com/watch?v=Fj9ECUW9nxc
> [4]
> http://fusesource.com/require_registration_for?url=http://streaming.progress.com/fusesource/102711_FUSE_part_1_CM/index.htm
> [5]
> http://fusesource.com/require_registration_for?url=http://streaming.progress.com/fusesource/112211_FUSE_Part_2_CM/index.htm
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279p5719433.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Distributed transaction in camel route

Posted by James Carman <ja...@carmanconsulting.com>.
Marking the JMS component as "transacted" and giving it a reference to
the JmsTransactionManager will cause it to do JMS transactions.

On Fri, Sep 21, 2012 at 4:55 PM, mabahma <ma...@hotmail.com> wrote:
> Hello all,
>
> We are using distributed transaction in a Camel route where messages are
> sent to a JMS queue (ActiveMQ broker) then picked by a processor bean and
> persisted in Oracle database.
>
> We first used XA transactions with Atomikos but the performances (number of
> processed messages) were not 't as good as expected.
>
> So we want now to use the scenario in "compensation transaction" sample with
> two transactions managers.
>
> Have any one tried the two options ?  are the performances better in one or
> other case ?
>
> or is there any other option that gives better performances ?
>
> If the processor fails to persist a message into DB how , can we roll back
> the jms message ?
>
>
> *public void process(Exchange exchange){
>
>
>  Strring msg  =  exchange.getIn().getBody;
>
>
> Dao.persist(msg)
>
> // if persist fails, how to tell camel not ot commit jms message here ?
> // we have only acess to exchange..
>
> }
> *
>
>
>
>
> have you any examples ?
>
> There also one thing we don't understand very clearly :
>
> When should we declare a route transacted (XA transactions? two transactions
> managers? never?) ?
> When should we declare JMS queue transacted (XA transactions? two
> transactions managers? never?)
>
> if we go for two transaction managers (jms+jpa), which should be declared
> transacted (route? jms ? both? no one?)
>
> Thanks
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279p5719733.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Distributed transaction in camel route

Posted by mabahma <ma...@hotmail.com>.
Hello all,

We are using distributed transaction in a Camel route where messages are
sent to a JMS queue (ActiveMQ broker) then picked by a processor bean and
persisted in Oracle database.

We first used XA transactions with Atomikos but the performances (number of
processed messages) were not 't as good as expected.

So we want now to use the scenario in "compensation transaction" sample with
two transactions managers.

Have any one tried the two options ?  are the performances better in one or
other case ?

or is there any other option that gives better performances ?

If the processor fails to persist a message into DB how , can we roll back
the jms message ?


*public void process(Exchange exchange){


 Strring msg  =  exchange.getIn().getBody;


Dao.persist(msg)

// if persist fails, how to tell camel not ot commit jms message here ?
// we have only acess to exchange..

}
*




have you any examples ?

There also one thing we don't understand very clearly :

When should we declare a route transacted (XA transactions? two transactions
managers? never?) ?
When should we declare JMS queue transacted (XA transactions? two
transactions managers? never?)

if we go for two transaction managers (jms+jpa), which should be declared
transacted (route? jms ? both? no one?)

Thanks 




--
View this message in context: http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279p5719733.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Distributed transaction in camel route

Posted by Caa_man <ca...@acs-it.ru>.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-2.0.xsd
    http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
 http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">

  <bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
        <property name="connectionFactory" ref="wmqConnectionFactory"/>
        <property name="transactionManager" ref="transactionManager"/>
        <property name="transacted" value="false"/>
  </bean>
   <bean id="required"
class="org.apache.camel.spring.spi.SpringTransactionPolicy">
        <property name="transactionManager" ref="transactionManager"/>
        <property name="propagationBehaviorName"
value="PROPAGATION_REQUIRED"/>
   </bean>
    <bean id="wmqConnectionFactory"
class="com.ibm.mq.jms.MQXAConnectionFactory">
        <... connection properties...>
    </bean>

    <tx:annotation-driven transaction-manager="transactionManager" />
    <bean id="transactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager"/>

  <bean id="mqRemoteSender" class="... custom class that can send mq
messages via com.ibm.mq.MQQueue">
        <... sending properties ...>
   </bean>

    <... entity beans:
org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager,
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean,
org.springframework.orm.jpa.JpaTemplate etc...>

   <bean id="logger" class="... custom logger class..."/>

    <camelContext trace="true"
xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="wmq:queue:INNER_QUEUE"/>
            <transacted ref="required"/>
            <doTry>
                <...CAMEL processes where I parse xml-message and save its
properties to DB ...>
                <... Process where I create response xml-message ...>
                <bean ref="logger" method="luckyMessage"/>
                <to uri="bean:mqRemoteSender?method=remoteRoute"/>
             <doCatch>
             
<exception>org.springframework.dao.DataAccessException</exception>
              <handled>
                     <constant>false</constant>
              </handled>
                 <bean ref="logger" method="saveDBErrorMessage"/>
                 <...Error message creation process...>
                 <to uri="bean:mqRemoteSender?method=remoteRoute"/>
              </doCatch>
              <doCatch>
                <exception>java.lang.Exception</exception>
                <handled>
                    <constant>false</constant>
                 </handled>
                 <bean ref="logger" method="commonErrorMessage"/>
                 <...Error message creation process...>
                 <to uri="bean:mqRemoteSender?method=remoteRoute"/>
               </doCatch>
               </doTry>
        </route>
    </camelContext> 
</beans>




--
View this message in context: http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279p5719586.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Distributed transaction in camel route

Posted by James Carman <ja...@carmanconsulting.com>.
Would you be willing to share your configuration (except for
passwords) that works for you so that other folks "googling" might be
able to learn from what you've discovered?

On Tue, Sep 18, 2012 at 7:39 AM, Caa_man <ca...@acs-it.ru> wrote:
> Thank you!
>
> Distributed transaction really works with  <property name="transacted"
> value="false"/> and com.ibm.mq.jms.MQXAConnectionFactory class using.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279p5719521.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Distributed transaction in camel route

Posted by Christian Müller <ch...@gmail.com>.
Good to know you could figure it out by yourself.

Enjoi your further Camel ride,
Christian

Sent from a mobile device
Am 18.09.2012 13:45 schrieb "Caa_man" <ca...@acs-it.ru>:

> Thank you!
>
> Distributed transaction really works with  <property name="transacted"
> value="false"/> and com.ibm.mq.jms.MQXAConnectionFactory class using.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279p5719521.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Distributed transaction in camel route

Posted by Caa_man <ca...@acs-it.ru>.
Thank you!

Distributed transaction really works with  <property name="transacted"
value="false"/> and com.ibm.mq.jms.MQXAConnectionFactory class using.



--
View this message in context: http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279p5719521.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Distributed transaction in camel route

Posted by Christian Müller <ch...@gmail.com>.
Good explanation what I really wanted to say... ;-)

Best,
Christian

On Sun, Sep 16, 2012 at 6:53 PM, Raul Kripalani <ra...@evosent.com> wrote:

> Hi James,
>
> By using singular transactions rather than distributed transactions (XA),
> each resource involved is responsible for managing its own transaction,
> i.e.
> the JMS session and the JDBC DataSource will run separate transactions.
>
> Camel has a concept called "Unit of Work" that is used to synchronise
> transactions, or quasi-transactional behaviour, across several endpoints in
> a route. An example of a "quasi-transactional" action is found in the File
> consumer endpoint, where the file only will be moved to the "done"
> directory
> if the route hasn't failed. Otherwise it will be moved to the "failed"
> directory.
>
> In the scenario that Christian proposes, the JMS consumer will begin a
> transaction and will wait till the Exchange is done. At that point, it will
> decide whether to commit or rollback the transaction depending on if
> there's
> an Exception set or not in the Exchange. This way, you don't get full XA
> behaviour, but you get something pretty close. There's still a risk of JMS
> and JDBC becoming falling out of sync if Camel crashes after JDBC commits
> but before the JMS endpoint is notified of the DONE exchange and commits
> the
> local transaction there.
>
> To use this approach, you want to set transacted=true at the JMS consumer,
> so that the JMS endpoint will manage its transaction.
>
> On the other hand, XA is a different story. With XA, you don't want Camel
> to
> manage the transaction (you set transacted=false on the endpoint), because
> the XAResource will enlist itself in the transaction automatically. If you
> set transacted=true with XA, you'll begin to see exceptions due to the JMS
> XAResouce being enlisted twice.
>
> While I worked at FuseSource, Charles Moulliard and I created examples
> showing both:
> a) XA Transactions involving JMS and JDBC
> b) JMS + JDBC local transactions
>
> You can find the source code here: [1] and [2]. Here is a video with the
> demo: [3], and the full webinar is split in two parts: [4] and [5].
>
> Hope that helps!
> Raúl.
>
> ---
> Raúl Kripalani
> Enterprise Architect, Program Manager, Open Source Integration specialist
> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk
>
> [1] https://github.com/FuseByExample/camel-persistence-part1
> [2] https://github.com/FuseByExample/camel-persistence-part2
> [3] http://www.youtube.com/watch?v=Fj9ECUW9nxc
> [4]
>
> http://fusesource.com/require_registration_for?url=http://streaming.progress.com/fusesource/102711_FUSE_part_1_CM/index.htm
> [5]
>
> http://fusesource.com/require_registration_for?url=http://streaming.progress.com/fusesource/112211_FUSE_Part_2_CM/index.htm
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279p5719433.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--

Re: Distributed transaction in camel route

Posted by Raul Kripalani <ra...@evosent.com>.
Hi James,

By using singular transactions rather than distributed transactions (XA),
each resource involved is responsible for managing its own transaction, i.e.
the JMS session and the JDBC DataSource will run separate transactions.

Camel has a concept called "Unit of Work" that is used to synchronise
transactions, or quasi-transactional behaviour, across several endpoints in
a route. An example of a "quasi-transactional" action is found in the File
consumer endpoint, where the file only will be moved to the "done" directory
if the route hasn't failed. Otherwise it will be moved to the "failed"
directory.

In the scenario that Christian proposes, the JMS consumer will begin a
transaction and will wait till the Exchange is done. At that point, it will
decide whether to commit or rollback the transaction depending on if there's
an Exception set or not in the Exchange. This way, you don't get full XA
behaviour, but you get something pretty close. There's still a risk of JMS
and JDBC becoming falling out of sync if Camel crashes after JDBC commits
but before the JMS endpoint is notified of the DONE exchange and commits the
local transaction there.

To use this approach, you want to set transacted=true at the JMS consumer,
so that the JMS endpoint will manage its transaction.

On the other hand, XA is a different story. With XA, you don't want Camel to
manage the transaction (you set transacted=false on the endpoint), because
the XAResource will enlist itself in the transaction automatically. If you
set transacted=true with XA, you'll begin to see exceptions due to the JMS
XAResouce being enlisted twice.

While I worked at FuseSource, Charles Moulliard and I created examples
showing both:
a) XA Transactions involving JMS and JDBC
b) JMS + JDBC local transactions

You can find the source code here: [1] and [2]. Here is a video with the
demo: [3], and the full webinar is split in two parts: [4] and [5].

Hope that helps!
Raúl.

---
Raúl Kripalani
Enterprise Architect, Program Manager, Open Source Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

[1] https://github.com/FuseByExample/camel-persistence-part1
[2] https://github.com/FuseByExample/camel-persistence-part2
[3] http://www.youtube.com/watch?v=Fj9ECUW9nxc
[4]
http://fusesource.com/require_registration_for?url=http://streaming.progress.com/fusesource/102711_FUSE_part_1_CM/index.htm
[5]
http://fusesource.com/require_registration_for?url=http://streaming.progress.com/fusesource/112211_FUSE_Part_2_CM/index.htm



--
View this message in context: http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279p5719433.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Distributed transaction in camel route

Posted by James Carman <jc...@carmanconsulting.com>.
So, which transaction manager would you give to the jms component?  The jms one?  Then the db inserts/updates would use the Aries transaction manager?  I'll use your example project as a sandbox to play with this setup.  Thanks again!

On Sep 15, 2012, at 4:54 PM, Christian Müller <ch...@gmail.com> wrote:

> You could use a "normal" JMS transaction to read your JMS message and write
> the response back into a queue (in the same transaction of course).
> Make sure your database inserts/updates are committed all together.
> If your database insert/update fails, the JMS transaction manager will
> rollback your transaction and the JMS message will be put back into your
> queue.
> If the insert/update was successful, the JMS transaction will be comitted
> which means the message you read will be deleted and the response message
> will be committed into the response queue.
> 
> There is a potential risks:
> - The database insert/update was successful and before you could commit the
> JMS transaction, the JMS broker went down. After restarting the broker, the
> message will be redelivered because of the missing commit. May be this is
> not a problem, if your database access is idempotent (if you execute an
> update or a stored procedure which checks for duplicated before it executes
> the insert or ...).
> 
> May be this link is also helpful for your:
> http://www.javaworld.com/javaworld/jw-01-2009/jw-01-spring-transactions.html
> 
> Best,
> Christian
> 
> On Fri, Sep 14, 2012 at 3:28 PM, James Carman <ja...@carmanconsulting.com>wrote:
> 
>> Christian,
>> 
>> Also, what we're looking to do is use non-XA WebSphere MQ connections.
>> So, we need to figure out how to configure this stuff using non-XA
>> JMS, but still have it behave correctly.  We are using DBCP's
>> "managed" pool support for the data sources.  We believe that's
>> working okay.
>> 
>> Thanks,
>> 
>> James
>> 
>> On Thu, Sep 13, 2012 at 6:11 PM, Christian Müller
>> <ch...@gmail.com> wrote:
>>> May be these examples are useful for you:
>>> https://github.com/muellerc/camel-in-transaction
>>> 
>>> Best,
>>> Christian
>>> 
>>> On Thu, Sep 13, 2012 at 4:33 PM, James Carman <
>> james@carmanconsulting.com>wrote:
>>> 
>>>> Claus,
>>>> 
>>>> Is there any guidance on how to set up XA correctly?  We're having a
>>>> really rough time getting Websphere MQ and SQL Server connections to
>>>> work together in an XA fashion.
>>>> 
>>>> Thanks,
>>>> 
>>>> james
>>>> 
>>>> On Thu, Sep 13, 2012 at 10:17 AM, Claus Ibsen <cl...@gmail.com>
>>>> wrote:
>>>>> For that you would need XA when you have 2+ resources participating in
>>>>> the same transaction.
>>>>> It can be tricky to setup. You would need to use the JTA transaction
>>>>> manager from WebSphere etc which supports XA.
>>>>> 
>>>>> Make sure the MQ connection factory you refer to is the XA one.
>>>>> 
>>>>> On Thu, Sep 13, 2012 at 2:59 PM, Caa_man <ca...@acs-it.ru> wrote:
>>>>>> Hello!
>>>>>> 
>>>>>> I`d like to built a camel route with this logic:
>>>>>> 
>>>>>>  - receive message with XML from WebSphere queue (camel "from")
>>>>>>  - begin transaction (distributed transaction via "transacted")
>>>>>>  - parse xml (camel "process")
>>>>>>  - save income message to Oracle DB (camel "process")
>>>>>>  - create reply message (camel "process")
>>>>>>  - send reply message to WebSphere queue (camel "to" with
>>>>>> uri="bean:mqRemoteSender?method=remoteRoute", where I manually send
>>>>>> camel-message body to MQQueue object)
>>>>>> 
>>>>>> i.e. I`d like to do "INSERT" request to DB and send message in single
>>>>>> transaction.
>>>>>> 
>>>>>> I use:
>>>>>> 
>>>>>> 1) JmsComponent:
>>>>>>  <bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
>>>>>>        <property name="connectionFactory"
>> ref="wmqConnectionFactory"/>
>>>>>>        <property name="concurrentConsumers" value="5"/>
>>>>>>        <property name="maxConcurrentConsumers" value="5"/>
>>>>>>        <property name="transactionManager"
>> ref="transactionManager"/>
>>>>>>        <property name="transacted" value="true"/>
>>>>>>  </bean>
>>>>>>  <bean id="wmqConnectionFactory"
>>>>>> class="com.ibm.mq.jms.MQConnectionFactory">
>>>>>>        <property name="transportType" value="1"/>
>>>>>>        <property name="hostName" value="${HostName}"/>
>>>>>>        <property name="port">
>>>>>>             <bean id="portValue" class="java.lang.Integer">
>>>>>>                 <constructor-arg value="${PortValue}"/>
>>>>>>             </bean>
>>>>>>        </property>
>>>>>>        <property name="queueManager" value="${ManagerName}"/>
>>>>>>        <property name="channel" value="${ConnectionChannel}"/>
>>>>>>  </bean>
>>>>>> 2) Transaction policy:
>>>>>>   <bean id="required"
>>>>>> class="org.apache.camel.spring.spi.SpringTransactionPolicy">
>>>>>>        <property name="transactionManager"
>> ref="transactionManager"/>
>>>>>>        <property name="propagationBehaviorName"
>>>>>> value="PROPAGATION_REQUIRED"/>
>>>>>>   </bean>
>>>>>> 3)  Transaction manager:
>>>>>>    <bean id="transactionManager"
>>>>>> class="org.springframework.transaction.jta.JtaTransactionManager"/>
>>>>>> 4)  Annotation driver:
>>>>>>   <tx:annotation-driven transaction-manager="transactionManager" />
>>>>>> 5) Process with DB save requests:
>>>>>> 
>>>>>>    private org.springframework.orm.jpa.JpaTemplate jtaTemplate;
>>>>>> 
>>>>>>    @Transactional(propagation = Propagation.REQUIRED)
>>>>>>    @Override
>>>>>>    public void process(Exchange exchange) throws Exception {
>>>>>>      SomeEntityClass entityObject = new SomeEntityClass();
>>>>>>     ...
>>>>>>      jtaTemplate.persist(entityObject);
>>>>>>      jtaTemplate.flush();
>>>>>>   }
>>>>>> 6) persistence-unit:
>>>>>>        <persistence-unit name="jpaName" transaction-type="JTA">
>>>>>> 
>>>> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
>>>>>>        <jta-data-source>jdbc/applicationConnection</jta-data-source>
>>>>>>        <mapping-file>META-INF/orm.xml</mapping-file>
>>>>>>                <class>SomeEntityClass</class>
>>>>>>                <properties>
>>>>>>                        <property name="eclipselink.target-server"
>>>> value="OC4J" />
>>>>>>                        <property name="eclipselink.target-database"
>>>> value="Oracle" />
>>>>>>                        <property name="eclipselink.weaving"
>>>> value="false" />
>>>>>>                        <property name="eclipselink.logging.level"
>>>> value="FINE" />
>>>>>>                        <property
>>>> name="eclipselink.cache.shared.default" value="false"/>
>>>>>>            <property name="eclipselink.jdbc.batch-writing"
>>>>>> value="Oracle-JDBC" />
>>>>>>            <property name="eclipselink.jdbc.fetch-size"
>> value="1000" />
>>>>>>                </properties>
>>>>>>        </persistence-unit>
>>>>>> 
>>>>>> But there is no distributed transaction.
>>>>>> Oracle-db-transaction and wmq-send-transaction are independent from
>>>>>> jms-receive-transaction.
>>>>>> Whats wrong?
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> View this message in context:
>>>> 
>> http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279.html
>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Claus Ibsen
>>>>> -----------------
>>>>> FuseSource
>>>>> Email: cibsen@fusesource.com
>>>>> Web: http://fusesource.com
>>>>> Twitter: davsclaus, fusenews
>>>>> Blog: http://davsclaus.com
>>>>> Author of Camel in Action: http://www.manning.com/ibsen
>>>> 
>>> 
>>> 
>>> 
>>> --
>> 
> 
> 
> 
> --

Re: Distributed transaction in camel route

Posted by Christian Müller <ch...@gmail.com>.
You could use a "normal" JMS transaction to read your JMS message and write
the response back into a queue (in the same transaction of course).
Make sure your database inserts/updates are committed all together.
If your database insert/update fails, the JMS transaction manager will
rollback your transaction and the JMS message will be put back into your
queue.
If the insert/update was successful, the JMS transaction will be comitted
which means the message you read will be deleted and the response message
will be committed into the response queue.

There is a potential risks:
- The database insert/update was successful and before you could commit the
JMS transaction, the JMS broker went down. After restarting the broker, the
message will be redelivered because of the missing commit. May be this is
not a problem, if your database access is idempotent (if you execute an
update or a stored procedure which checks for duplicated before it executes
the insert or ...).

May be this link is also helpful for your:
http://www.javaworld.com/javaworld/jw-01-2009/jw-01-spring-transactions.html

Best,
Christian

On Fri, Sep 14, 2012 at 3:28 PM, James Carman <ja...@carmanconsulting.com>wrote:

> Christian,
>
> Also, what we're looking to do is use non-XA WebSphere MQ connections.
>  So, we need to figure out how to configure this stuff using non-XA
> JMS, but still have it behave correctly.  We are using DBCP's
> "managed" pool support for the data sources.  We believe that's
> working okay.
>
> Thanks,
>
> James
>
> On Thu, Sep 13, 2012 at 6:11 PM, Christian Müller
> <ch...@gmail.com> wrote:
> > May be these examples are useful for you:
> > https://github.com/muellerc/camel-in-transaction
> >
> > Best,
> > Christian
> >
> > On Thu, Sep 13, 2012 at 4:33 PM, James Carman <
> james@carmanconsulting.com>wrote:
> >
> >> Claus,
> >>
> >> Is there any guidance on how to set up XA correctly?  We're having a
> >> really rough time getting Websphere MQ and SQL Server connections to
> >> work together in an XA fashion.
> >>
> >> Thanks,
> >>
> >> james
> >>
> >> On Thu, Sep 13, 2012 at 10:17 AM, Claus Ibsen <cl...@gmail.com>
> >> wrote:
> >> > For that you would need XA when you have 2+ resources participating in
> >> > the same transaction.
> >> > It can be tricky to setup. You would need to use the JTA transaction
> >> > manager from WebSphere etc which supports XA.
> >> >
> >> > Make sure the MQ connection factory you refer to is the XA one.
> >> >
> >> > On Thu, Sep 13, 2012 at 2:59 PM, Caa_man <ca...@acs-it.ru> wrote:
> >> >> Hello!
> >> >>
> >> >> I`d like to built a camel route with this logic:
> >> >>
> >> >>   - receive message with XML from WebSphere queue (camel "from")
> >> >>   - begin transaction (distributed transaction via "transacted")
> >> >>   - parse xml (camel "process")
> >> >>   - save income message to Oracle DB (camel "process")
> >> >>   - create reply message (camel "process")
> >> >>   - send reply message to WebSphere queue (camel "to" with
> >> >> uri="bean:mqRemoteSender?method=remoteRoute", where I manually send
> >> >> camel-message body to MQQueue object)
> >> >>
> >> >> i.e. I`d like to do "INSERT" request to DB and send message in single
> >> >> transaction.
> >> >>
> >> >> I use:
> >> >>
> >> >> 1) JmsComponent:
> >> >>   <bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
> >> >>         <property name="connectionFactory"
> ref="wmqConnectionFactory"/>
> >> >>         <property name="concurrentConsumers" value="5"/>
> >> >>         <property name="maxConcurrentConsumers" value="5"/>
> >> >>         <property name="transactionManager"
> ref="transactionManager"/>
> >> >>         <property name="transacted" value="true"/>
> >> >>   </bean>
> >> >>   <bean id="wmqConnectionFactory"
> >> >> class="com.ibm.mq.jms.MQConnectionFactory">
> >> >>         <property name="transportType" value="1"/>
> >> >>         <property name="hostName" value="${HostName}"/>
> >> >>         <property name="port">
> >> >>              <bean id="portValue" class="java.lang.Integer">
> >> >>                  <constructor-arg value="${PortValue}"/>
> >> >>              </bean>
> >> >>         </property>
> >> >>         <property name="queueManager" value="${ManagerName}"/>
> >> >>         <property name="channel" value="${ConnectionChannel}"/>
> >> >>   </bean>
> >> >> 2) Transaction policy:
> >> >>    <bean id="required"
> >> >> class="org.apache.camel.spring.spi.SpringTransactionPolicy">
> >> >>         <property name="transactionManager"
> ref="transactionManager"/>
> >> >>         <property name="propagationBehaviorName"
> >> >> value="PROPAGATION_REQUIRED"/>
> >> >>    </bean>
> >> >> 3)  Transaction manager:
> >> >>     <bean id="transactionManager"
> >> >> class="org.springframework.transaction.jta.JtaTransactionManager"/>
> >> >> 4)  Annotation driver:
> >> >>    <tx:annotation-driven transaction-manager="transactionManager" />
> >> >> 5) Process with DB save requests:
> >> >>
> >> >>     private org.springframework.orm.jpa.JpaTemplate jtaTemplate;
> >> >>
> >> >>     @Transactional(propagation = Propagation.REQUIRED)
> >> >>     @Override
> >> >>     public void process(Exchange exchange) throws Exception {
> >> >>       SomeEntityClass entityObject = new SomeEntityClass();
> >> >>      ...
> >> >>       jtaTemplate.persist(entityObject);
> >> >>       jtaTemplate.flush();
> >> >>    }
> >> >> 6) persistence-unit:
> >> >>         <persistence-unit name="jpaName" transaction-type="JTA">
> >> >>
> >> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
> >> >>         <jta-data-source>jdbc/applicationConnection</jta-data-source>
> >> >>         <mapping-file>META-INF/orm.xml</mapping-file>
> >> >>                 <class>SomeEntityClass</class>
> >> >>                 <properties>
> >> >>                         <property name="eclipselink.target-server"
> >> value="OC4J" />
> >> >>                         <property name="eclipselink.target-database"
> >> value="Oracle" />
> >> >>                         <property name="eclipselink.weaving"
> >> value="false" />
> >> >>                         <property name="eclipselink.logging.level"
> >> value="FINE" />
> >> >>                         <property
> >> name="eclipselink.cache.shared.default" value="false"/>
> >> >>             <property name="eclipselink.jdbc.batch-writing"
> >> >> value="Oracle-JDBC" />
> >> >>             <property name="eclipselink.jdbc.fetch-size"
> value="1000" />
> >> >>                 </properties>
> >> >>         </persistence-unit>
> >> >>
> >> >> But there is no distributed transaction.
> >> >> Oracle-db-transaction and wmq-send-transaction are independent from
> >> >> jms-receive-transaction.
> >> >> Whats wrong?
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> View this message in context:
> >>
> http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279.html
> >> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >> >
> >> >
> >> >
> >> > --
> >> > Claus Ibsen
> >> > -----------------
> >> > FuseSource
> >> > Email: cibsen@fusesource.com
> >> > Web: http://fusesource.com
> >> > Twitter: davsclaus, fusenews
> >> > Blog: http://davsclaus.com
> >> > Author of Camel in Action: http://www.manning.com/ibsen
> >>
> >
> >
> >
> > --
>



--

Re: Distributed transaction in camel route

Posted by James Carman <ja...@carmanconsulting.com>.
Christian,

Also, what we're looking to do is use non-XA WebSphere MQ connections.
 So, we need to figure out how to configure this stuff using non-XA
JMS, but still have it behave correctly.  We are using DBCP's
"managed" pool support for the data sources.  We believe that's
working okay.

Thanks,

James

On Thu, Sep 13, 2012 at 6:11 PM, Christian Müller
<ch...@gmail.com> wrote:
> May be these examples are useful for you:
> https://github.com/muellerc/camel-in-transaction
>
> Best,
> Christian
>
> On Thu, Sep 13, 2012 at 4:33 PM, James Carman <ja...@carmanconsulting.com>wrote:
>
>> Claus,
>>
>> Is there any guidance on how to set up XA correctly?  We're having a
>> really rough time getting Websphere MQ and SQL Server connections to
>> work together in an XA fashion.
>>
>> Thanks,
>>
>> james
>>
>> On Thu, Sep 13, 2012 at 10:17 AM, Claus Ibsen <cl...@gmail.com>
>> wrote:
>> > For that you would need XA when you have 2+ resources participating in
>> > the same transaction.
>> > It can be tricky to setup. You would need to use the JTA transaction
>> > manager from WebSphere etc which supports XA.
>> >
>> > Make sure the MQ connection factory you refer to is the XA one.
>> >
>> > On Thu, Sep 13, 2012 at 2:59 PM, Caa_man <ca...@acs-it.ru> wrote:
>> >> Hello!
>> >>
>> >> I`d like to built a camel route with this logic:
>> >>
>> >>   - receive message with XML from WebSphere queue (camel "from")
>> >>   - begin transaction (distributed transaction via "transacted")
>> >>   - parse xml (camel "process")
>> >>   - save income message to Oracle DB (camel "process")
>> >>   - create reply message (camel "process")
>> >>   - send reply message to WebSphere queue (camel "to" with
>> >> uri="bean:mqRemoteSender?method=remoteRoute", where I manually send
>> >> camel-message body to MQQueue object)
>> >>
>> >> i.e. I`d like to do "INSERT" request to DB and send message in single
>> >> transaction.
>> >>
>> >> I use:
>> >>
>> >> 1) JmsComponent:
>> >>   <bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
>> >>         <property name="connectionFactory" ref="wmqConnectionFactory"/>
>> >>         <property name="concurrentConsumers" value="5"/>
>> >>         <property name="maxConcurrentConsumers" value="5"/>
>> >>         <property name="transactionManager" ref="transactionManager"/>
>> >>         <property name="transacted" value="true"/>
>> >>   </bean>
>> >>   <bean id="wmqConnectionFactory"
>> >> class="com.ibm.mq.jms.MQConnectionFactory">
>> >>         <property name="transportType" value="1"/>
>> >>         <property name="hostName" value="${HostName}"/>
>> >>         <property name="port">
>> >>              <bean id="portValue" class="java.lang.Integer">
>> >>                  <constructor-arg value="${PortValue}"/>
>> >>              </bean>
>> >>         </property>
>> >>         <property name="queueManager" value="${ManagerName}"/>
>> >>         <property name="channel" value="${ConnectionChannel}"/>
>> >>   </bean>
>> >> 2) Transaction policy:
>> >>    <bean id="required"
>> >> class="org.apache.camel.spring.spi.SpringTransactionPolicy">
>> >>         <property name="transactionManager" ref="transactionManager"/>
>> >>         <property name="propagationBehaviorName"
>> >> value="PROPAGATION_REQUIRED"/>
>> >>    </bean>
>> >> 3)  Transaction manager:
>> >>     <bean id="transactionManager"
>> >> class="org.springframework.transaction.jta.JtaTransactionManager"/>
>> >> 4)  Annotation driver:
>> >>    <tx:annotation-driven transaction-manager="transactionManager" />
>> >> 5) Process with DB save requests:
>> >>
>> >>     private org.springframework.orm.jpa.JpaTemplate jtaTemplate;
>> >>
>> >>     @Transactional(propagation = Propagation.REQUIRED)
>> >>     @Override
>> >>     public void process(Exchange exchange) throws Exception {
>> >>       SomeEntityClass entityObject = new SomeEntityClass();
>> >>      ...
>> >>       jtaTemplate.persist(entityObject);
>> >>       jtaTemplate.flush();
>> >>    }
>> >> 6) persistence-unit:
>> >>         <persistence-unit name="jpaName" transaction-type="JTA">
>> >>
>> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
>> >>         <jta-data-source>jdbc/applicationConnection</jta-data-source>
>> >>         <mapping-file>META-INF/orm.xml</mapping-file>
>> >>                 <class>SomeEntityClass</class>
>> >>                 <properties>
>> >>                         <property name="eclipselink.target-server"
>> value="OC4J" />
>> >>                         <property name="eclipselink.target-database"
>> value="Oracle" />
>> >>                         <property name="eclipselink.weaving"
>> value="false" />
>> >>                         <property name="eclipselink.logging.level"
>> value="FINE" />
>> >>                         <property
>> name="eclipselink.cache.shared.default" value="false"/>
>> >>             <property name="eclipselink.jdbc.batch-writing"
>> >> value="Oracle-JDBC" />
>> >>             <property name="eclipselink.jdbc.fetch-size" value="1000" />
>> >>                 </properties>
>> >>         </persistence-unit>
>> >>
>> >> But there is no distributed transaction.
>> >> Oracle-db-transaction and wmq-send-transaction are independent from
>> >> jms-receive-transaction.
>> >> Whats wrong?
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279.html
>> >> Sent from the Camel - Users mailing list archive at Nabble.com.
>> >
>> >
>> >
>> > --
>> > Claus Ibsen
>> > -----------------
>> > FuseSource
>> > Email: cibsen@fusesource.com
>> > Web: http://fusesource.com
>> > Twitter: davsclaus, fusenews
>> > Blog: http://davsclaus.com
>> > Author of Camel in Action: http://www.manning.com/ibsen
>>
>
>
>
> --

Re: Distributed transaction in camel route

Posted by Christian Müller <ch...@gmail.com>.
May be these examples are useful for you:
https://github.com/muellerc/camel-in-transaction

Best,
Christian

On Thu, Sep 13, 2012 at 4:33 PM, James Carman <ja...@carmanconsulting.com>wrote:

> Claus,
>
> Is there any guidance on how to set up XA correctly?  We're having a
> really rough time getting Websphere MQ and SQL Server connections to
> work together in an XA fashion.
>
> Thanks,
>
> james
>
> On Thu, Sep 13, 2012 at 10:17 AM, Claus Ibsen <cl...@gmail.com>
> wrote:
> > For that you would need XA when you have 2+ resources participating in
> > the same transaction.
> > It can be tricky to setup. You would need to use the JTA transaction
> > manager from WebSphere etc which supports XA.
> >
> > Make sure the MQ connection factory you refer to is the XA one.
> >
> > On Thu, Sep 13, 2012 at 2:59 PM, Caa_man <ca...@acs-it.ru> wrote:
> >> Hello!
> >>
> >> I`d like to built a camel route with this logic:
> >>
> >>   - receive message with XML from WebSphere queue (camel "from")
> >>   - begin transaction (distributed transaction via "transacted")
> >>   - parse xml (camel "process")
> >>   - save income message to Oracle DB (camel "process")
> >>   - create reply message (camel "process")
> >>   - send reply message to WebSphere queue (camel "to" with
> >> uri="bean:mqRemoteSender?method=remoteRoute", where I manually send
> >> camel-message body to MQQueue object)
> >>
> >> i.e. I`d like to do "INSERT" request to DB and send message in single
> >> transaction.
> >>
> >> I use:
> >>
> >> 1) JmsComponent:
> >>   <bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
> >>         <property name="connectionFactory" ref="wmqConnectionFactory"/>
> >>         <property name="concurrentConsumers" value="5"/>
> >>         <property name="maxConcurrentConsumers" value="5"/>
> >>         <property name="transactionManager" ref="transactionManager"/>
> >>         <property name="transacted" value="true"/>
> >>   </bean>
> >>   <bean id="wmqConnectionFactory"
> >> class="com.ibm.mq.jms.MQConnectionFactory">
> >>         <property name="transportType" value="1"/>
> >>         <property name="hostName" value="${HostName}"/>
> >>         <property name="port">
> >>              <bean id="portValue" class="java.lang.Integer">
> >>                  <constructor-arg value="${PortValue}"/>
> >>              </bean>
> >>         </property>
> >>         <property name="queueManager" value="${ManagerName}"/>
> >>         <property name="channel" value="${ConnectionChannel}"/>
> >>   </bean>
> >> 2) Transaction policy:
> >>    <bean id="required"
> >> class="org.apache.camel.spring.spi.SpringTransactionPolicy">
> >>         <property name="transactionManager" ref="transactionManager"/>
> >>         <property name="propagationBehaviorName"
> >> value="PROPAGATION_REQUIRED"/>
> >>    </bean>
> >> 3)  Transaction manager:
> >>     <bean id="transactionManager"
> >> class="org.springframework.transaction.jta.JtaTransactionManager"/>
> >> 4)  Annotation driver:
> >>    <tx:annotation-driven transaction-manager="transactionManager" />
> >> 5) Process with DB save requests:
> >>
> >>     private org.springframework.orm.jpa.JpaTemplate jtaTemplate;
> >>
> >>     @Transactional(propagation = Propagation.REQUIRED)
> >>     @Override
> >>     public void process(Exchange exchange) throws Exception {
> >>       SomeEntityClass entityObject = new SomeEntityClass();
> >>      ...
> >>       jtaTemplate.persist(entityObject);
> >>       jtaTemplate.flush();
> >>    }
> >> 6) persistence-unit:
> >>         <persistence-unit name="jpaName" transaction-type="JTA">
> >>
> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
> >>         <jta-data-source>jdbc/applicationConnection</jta-data-source>
> >>         <mapping-file>META-INF/orm.xml</mapping-file>
> >>                 <class>SomeEntityClass</class>
> >>                 <properties>
> >>                         <property name="eclipselink.target-server"
> value="OC4J" />
> >>                         <property name="eclipselink.target-database"
> value="Oracle" />
> >>                         <property name="eclipselink.weaving"
> value="false" />
> >>                         <property name="eclipselink.logging.level"
> value="FINE" />
> >>                         <property
> name="eclipselink.cache.shared.default" value="false"/>
> >>             <property name="eclipselink.jdbc.batch-writing"
> >> value="Oracle-JDBC" />
> >>             <property name="eclipselink.jdbc.fetch-size" value="1000" />
> >>                 </properties>
> >>         </persistence-unit>
> >>
> >> But there is no distributed transaction.
> >> Oracle-db-transaction and wmq-send-transaction are independent from
> >> jms-receive-transaction.
> >> Whats wrong?
> >>
> >>
> >>
> >> --
> >> View this message in context:
> http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279.html
> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > FuseSource
> > Email: cibsen@fusesource.com
> > Web: http://fusesource.com
> > Twitter: davsclaus, fusenews
> > Blog: http://davsclaus.com
> > Author of Camel in Action: http://www.manning.com/ibsen
>



--

Re: Distributed transaction in camel route

Posted by James Carman <ja...@carmanconsulting.com>.
Claus,

Is there any guidance on how to set up XA correctly?  We're having a
really rough time getting Websphere MQ and SQL Server connections to
work together in an XA fashion.

Thanks,

james

On Thu, Sep 13, 2012 at 10:17 AM, Claus Ibsen <cl...@gmail.com> wrote:
> For that you would need XA when you have 2+ resources participating in
> the same transaction.
> It can be tricky to setup. You would need to use the JTA transaction
> manager from WebSphere etc which supports XA.
>
> Make sure the MQ connection factory you refer to is the XA one.
>
> On Thu, Sep 13, 2012 at 2:59 PM, Caa_man <ca...@acs-it.ru> wrote:
>> Hello!
>>
>> I`d like to built a camel route with this logic:
>>
>>   - receive message with XML from WebSphere queue (camel "from")
>>   - begin transaction (distributed transaction via "transacted")
>>   - parse xml (camel "process")
>>   - save income message to Oracle DB (camel "process")
>>   - create reply message (camel "process")
>>   - send reply message to WebSphere queue (camel "to" with
>> uri="bean:mqRemoteSender?method=remoteRoute", where I manually send
>> camel-message body to MQQueue object)
>>
>> i.e. I`d like to do "INSERT" request to DB and send message in single
>> transaction.
>>
>> I use:
>>
>> 1) JmsComponent:
>>   <bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
>>         <property name="connectionFactory" ref="wmqConnectionFactory"/>
>>         <property name="concurrentConsumers" value="5"/>
>>         <property name="maxConcurrentConsumers" value="5"/>
>>         <property name="transactionManager" ref="transactionManager"/>
>>         <property name="transacted" value="true"/>
>>   </bean>
>>   <bean id="wmqConnectionFactory"
>> class="com.ibm.mq.jms.MQConnectionFactory">
>>         <property name="transportType" value="1"/>
>>         <property name="hostName" value="${HostName}"/>
>>         <property name="port">
>>              <bean id="portValue" class="java.lang.Integer">
>>                  <constructor-arg value="${PortValue}"/>
>>              </bean>
>>         </property>
>>         <property name="queueManager" value="${ManagerName}"/>
>>         <property name="channel" value="${ConnectionChannel}"/>
>>   </bean>
>> 2) Transaction policy:
>>    <bean id="required"
>> class="org.apache.camel.spring.spi.SpringTransactionPolicy">
>>         <property name="transactionManager" ref="transactionManager"/>
>>         <property name="propagationBehaviorName"
>> value="PROPAGATION_REQUIRED"/>
>>    </bean>
>> 3)  Transaction manager:
>>     <bean id="transactionManager"
>> class="org.springframework.transaction.jta.JtaTransactionManager"/>
>> 4)  Annotation driver:
>>    <tx:annotation-driven transaction-manager="transactionManager" />
>> 5) Process with DB save requests:
>>
>>     private org.springframework.orm.jpa.JpaTemplate jtaTemplate;
>>
>>     @Transactional(propagation = Propagation.REQUIRED)
>>     @Override
>>     public void process(Exchange exchange) throws Exception {
>>       SomeEntityClass entityObject = new SomeEntityClass();
>>      ...
>>       jtaTemplate.persist(entityObject);
>>       jtaTemplate.flush();
>>    }
>> 6) persistence-unit:
>>         <persistence-unit name="jpaName" transaction-type="JTA">
>>         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
>>         <jta-data-source>jdbc/applicationConnection</jta-data-source>
>>         <mapping-file>META-INF/orm.xml</mapping-file>
>>                 <class>SomeEntityClass</class>
>>                 <properties>
>>                         <property name="eclipselink.target-server" value="OC4J" />
>>                         <property name="eclipselink.target-database" value="Oracle" />
>>                         <property name="eclipselink.weaving" value="false" />
>>                         <property name="eclipselink.logging.level" value="FINE" />
>>                         <property name="eclipselink.cache.shared.default" value="false"/>
>>             <property name="eclipselink.jdbc.batch-writing"
>> value="Oracle-JDBC" />
>>             <property name="eclipselink.jdbc.fetch-size" value="1000" />
>>                 </properties>
>>         </persistence-unit>
>>
>> But there is no distributed transaction.
>> Oracle-db-transaction and wmq-send-transaction are independent from
>> jms-receive-transaction.
>> Whats wrong?
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen

Re: Distributed transaction in camel route

Posted by Claus Ibsen <cl...@gmail.com>.
For that you would need XA when you have 2+ resources participating in
the same transaction.
It can be tricky to setup. You would need to use the JTA transaction
manager from WebSphere etc which supports XA.

Make sure the MQ connection factory you refer to is the XA one.

On Thu, Sep 13, 2012 at 2:59 PM, Caa_man <ca...@acs-it.ru> wrote:
> Hello!
>
> I`d like to built a camel route with this logic:
>
>   - receive message with XML from WebSphere queue (camel "from")
>   - begin transaction (distributed transaction via "transacted")
>   - parse xml (camel "process")
>   - save income message to Oracle DB (camel "process")
>   - create reply message (camel "process")
>   - send reply message to WebSphere queue (camel "to" with
> uri="bean:mqRemoteSender?method=remoteRoute", where I manually send
> camel-message body to MQQueue object)
>
> i.e. I`d like to do "INSERT" request to DB and send message in single
> transaction.
>
> I use:
>
> 1) JmsComponent:
>   <bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
>         <property name="connectionFactory" ref="wmqConnectionFactory"/>
>         <property name="concurrentConsumers" value="5"/>
>         <property name="maxConcurrentConsumers" value="5"/>
>         <property name="transactionManager" ref="transactionManager"/>
>         <property name="transacted" value="true"/>
>   </bean>
>   <bean id="wmqConnectionFactory"
> class="com.ibm.mq.jms.MQConnectionFactory">
>         <property name="transportType" value="1"/>
>         <property name="hostName" value="${HostName}"/>
>         <property name="port">
>              <bean id="portValue" class="java.lang.Integer">
>                  <constructor-arg value="${PortValue}"/>
>              </bean>
>         </property>
>         <property name="queueManager" value="${ManagerName}"/>
>         <property name="channel" value="${ConnectionChannel}"/>
>   </bean>
> 2) Transaction policy:
>    <bean id="required"
> class="org.apache.camel.spring.spi.SpringTransactionPolicy">
>         <property name="transactionManager" ref="transactionManager"/>
>         <property name="propagationBehaviorName"
> value="PROPAGATION_REQUIRED"/>
>    </bean>
> 3)  Transaction manager:
>     <bean id="transactionManager"
> class="org.springframework.transaction.jta.JtaTransactionManager"/>
> 4)  Annotation driver:
>    <tx:annotation-driven transaction-manager="transactionManager" />
> 5) Process with DB save requests:
>
>     private org.springframework.orm.jpa.JpaTemplate jtaTemplate;
>
>     @Transactional(propagation = Propagation.REQUIRED)
>     @Override
>     public void process(Exchange exchange) throws Exception {
>       SomeEntityClass entityObject = new SomeEntityClass();
>      ...
>       jtaTemplate.persist(entityObject);
>       jtaTemplate.flush();
>    }
> 6) persistence-unit:
>         <persistence-unit name="jpaName" transaction-type="JTA">
>         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
>         <jta-data-source>jdbc/applicationConnection</jta-data-source>
>         <mapping-file>META-INF/orm.xml</mapping-file>
>                 <class>SomeEntityClass</class>
>                 <properties>
>                         <property name="eclipselink.target-server" value="OC4J" />
>                         <property name="eclipselink.target-database" value="Oracle" />
>                         <property name="eclipselink.weaving" value="false" />
>                         <property name="eclipselink.logging.level" value="FINE" />
>                         <property name="eclipselink.cache.shared.default" value="false"/>
>             <property name="eclipselink.jdbc.batch-writing"
> value="Oracle-JDBC" />
>             <property name="eclipselink.jdbc.fetch-size" value="1000" />
>                 </properties>
>         </persistence-unit>
>
> But there is no distributed transaction.
> Oracle-db-transaction and wmq-send-transaction are independent from
> jms-receive-transaction.
> Whats wrong?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Distributed-transaction-in-camel-route-tp5719279.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen