aungmyo / camel-extra

Automatically exported from code.google.com/p/camel-extra
0 stars 0 forks source link

The Original exception got lost if a transaction from HibernateConsumer endpoint failed and rolled back #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please see attached test case for how to reproduce the problem. 

Basically, the test case showed a Camel route that involves a
HibernateConsumer endpoint and transaction. If a message failed along the
route and the transaction failed and rolled back, the original exception
(cause of the failure) was getting lost.

Below is the code from HibernateConsumer.java class:
protected void processResult(Object result) {
  // lets turn the result into an exchange and fire it
  // into the processor
  Exchange exchange = createExchange(result);
  try {
    getProcessor().process(exchange);
  } catch (Exception e) {
    LOG.error("Failed: " + e, e);
    throw new HibernateException(e);
  }
}

So the original exception was indeed caught and wrapped in the local object
"exchange". However it was not retrieved and propagated back to higher
level so after out of scope of this method, the exception got lost.

Original issue reported on code.google.com by Luo....@gmail.com on 12 Aug 2008 at 10:58

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed

Original comment by Luo....@gmail.com on 12 Aug 2008 at 12:14