Hi folks,

I have the following RouteBuilder:

   onException(Throwable.class)
        .handled(true)
        .bean(orderStateChanger, "changeOrderStateToWaiting")
        .to("jpa:Order");


    from("jms:order_queue")
        .routeId("Order_Route")
        .transacted()
        .setHeader(ORDER_ID_HEADER, simple("${body}"))
        .bean(orderByIdReader)
        .process(orderMapper)
        .to("cxf:bean:orderWebService")
        .process(postOrderProcessor);

The route reads an orderId from a jms-queue, sets this id to a header for
later use and enriches the message with the order read from the database.
Then the order ist mapped and send to a webservice. After returning some
postprocessing is done. All unittest using CamelSpringTestSupport work well.
So far so good.
Now integrating the solution in the real world shows some strange behaviour:
If an exception is thrown by the webservice the onException kicks in and the
StateChangerBean is called.
BUT: the change seems never to be committed. I thought that using the
jpa-component inside a springcontext would manage to handle all the tx-magic
but obviously that's not the case. Instead I see the following output in the
log:

TransactionErrorHandler - Transaction commit (0x550d4ee1) redelivered(true)
for (MessageId: ID:1D4923BFB6FF48CF997D5353C351D271 

I studied the documentation, but perhaps I searched in the wrong places? As
we say in german: Can anybody help me climb the correct camel, please? 


Regards,
Frank





--
View this message in context: 
http://camel.465427.n5.nabble.com/JPA-Endpoint-in-onException-is-not-committed-tp5765832.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to