Camel - Transactional

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

Camel - Transactional

srini8881
Hi,

This is my scenario:

from: A
 
I have routes to:

To: B (This is a File publishing component)
To: C (assume this is DB)

If there is an exception thrown during the process of committing to DB through the route C, then B should not publish the file.  In other words, there should be a rollback of routes B and C.  

I have create the Spring JTA manager and given <transacted/> in my route.  But no luck.  Irrespective of the error thrown from C, B still write the file.

Any help would be much appreciated!

Thanks
Srini.

Reply | Threaded
Open this post in threaded view
|

Re: Camel - Transactional

Christian Mueller
Administrator
The file component doesn't support real transactional behavior.

If you can change your route in the way that you first update the database and afterwards write the file, this should work. Because the jdbc/sql/jpa/mybatis/ibatis... components supports transactional behavior, you can simple rollback the database change if there is an exception writing the file.

Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Mon, Aug 12, 2013 at 9:08 PM, srini8881 [via Camel] <[hidden email]> wrote:
Hi,

This is my scenario:

from: A
 
I have routes to:

To: B (This is a File publishing component)
To: C (assume this is DB)

If there is an exception thrown during the process of committing to DB through the route C, then B should not publish the file.  In other words, there should be a rollback of routes B and C.  

I have create the Spring JTA manager and given <transacted/> in my route.  But no luck.  Irrespective of the error thrown from C, B still write the file.

Any help would be much appreciated!

Thanks
Srini.




If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Camel-Transactional-tp5737174.html
To start a new topic under Camel - Extra, email [hidden email]
To unsubscribe from Camel - Extra, click here.
NAML