two to-database-endpoints in one transaction

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

two to-database-endpoints in one transaction

pevgen
Hi.
I'm Camel's fan :)  But, I'm a beginer only.

How can I send a message in two endpoints in one transaction ? And if the second endpoint failed, then the first endpoint begin a rollback ?

My out-endpoints is transactional endpoints ("ibatis" for example).

snippet code :

<camelContext id="camelContext" xmlns="http://activemq.apache.org/camel/schema/spring">
   <route>
       <from uri="quartz://myGroup/myTimerName?trigger.repeatInterval=5000&amp;trigger.repeatCount=-1"/>                   

 <to uri="ibatis:insertHistory1"/>
 <to uri="ibatis:insertHistory2"/>
 <to uri="ibatis:insertHistory3"/>

   </route>
</camelContext>


Thanks
Evgeny
Reply | Threaded
Open this post in threaded view
|

Re: two to-database-endpoints in one transaction

bwtaylor
I'd like to know the answer to this too. I found this documentation: http://activemq.apache.org/camel/transactional-client.html

I assume you could do something like this with a jdbc transaction managers. One thing I didn't understand: where is the java code block that manipulates the PlatformTransactionManager supposed to go? Also it refers to a variable ctx whose origin isn't shown or explained. What kind of context is that?

I'd love to see more and better docs and examples regarding transaction management in general, including XA examples.

Reply | Threaded
Open this post in threaded view
|

RE: two to-database-endpoints in one transaction

Claus Ibsen
Good questions.

Added a ticket so its not forgotten - CAMEL-609


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: bwtaylor [mailto:[hidden email]]
Sent: 13. juni 2008 00:47
To: [hidden email]
Subject: Re: two to-database-endpoints in one transaction


I'd like to know the answer to this too. I found this documentation:
http://activemq.apache.org/camel/transactional-client.html

I assume you could do something like this with a jdbc transaction managers.
One thing I didn't understand: where is the java code block that manipulates
the PlatformTransactionManager supposed to go? Also it refers to a variable
ctx whose origin isn't shown or explained. What kind of context is that?

I'd love to see more and better docs and examples regarding transaction
management in general, including XA examples.


--
View this message in context: http://www.nabble.com/two-to-database-endpoints-in-one-transaction-tp17707633s22882p17811394.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

RE: two to-database-endpoints in one transaction

pevgen
Thank you, Claus.
Reply | Threaded
Open this post in threaded view
|

RE: two to-database-endpoints in one transaction

Claus Ibsen
In reply to this post by bwtaylor
Hi

Keep an eye on CAMEL-645. We will add some unit tests that demonstrates some usage of the transactional client EIP pattern.

I am unsure if the policy stuff has been ported to Spring XML as well so you might have to use Java DSL until its fully ported to Spring style configuration. There are a few gaps from the Java DSL to Spring DSL that we should start closing the gap for Camel 1.5.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: bwtaylor [mailto:[hidden email]]
Sent: 13. juni 2008 00:47
To: [hidden email]
Subject: Re: two to-database-endpoints in one transaction


I'd like to know the answer to this too. I found this documentation:
http://activemq.apache.org/camel/transactional-client.html

I assume you could do something like this with a jdbc transaction managers.
One thing I didn't understand: where is the java code block that manipulates
the PlatformTransactionManager supposed to go? Also it refers to a variable
ctx whose origin isn't shown or explained. What kind of context is that?

I'd love to see more and better docs and examples regarding transaction
management in general, including XA examples.


--
View this message in context: http://www.nabble.com/two-to-database-endpoints-in-one-transaction-tp17707633s22882p17811394.html
Sent from the Camel - Users mailing list archive at Nabble.com.