On Mon, Aug 24, 2009 at 7:48 PM, trivedi kumar
b<[email protected]> wrote:
>
>
> Hi All,
>
> I am new to this concept called using transactions inside my router. I did
> some googling on this, got some examples on jms Transaction Client. I am
> trying to use transactions in my router. Here is my requirement:
>
> In my router, I want to start a transaction (new one) before I proceed with
> next processor in the router. The next processor basically makes a call to a
> bean, which would either throw an error or successful message. If it is
> exception, I want to rollback the transaction.
>

What does your bean do?

Are you having 1 or 2 transactions? You state you want to start a new
one? Are there already an existing transaction running at that time?

I assume you want to use 1 transaction in total.
What you can do is that out of the box Camel will rollback the TX if
an exception is thrown.

So basically you do in 1.x
from(x)
  .policy(required)
  .beanRef(y)

And in 2.0:
from(x)
  .transacted()
  .beanRef(y)


Links
http://camel.apache.org/transactional-client.html






> Can someone help me on this?
>
> thanks in advance,
> Trivedi
> --
> View this message in context: 
> http://www.nabble.com/using-Transactions-in-the-camel-router-tp25120513p25120513.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to