Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 98445 invoked from network); 26 Oct 2009 20:11:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Oct 2009 20:11:16 -0000 Received: (qmail 72184 invoked by uid 500); 26 Oct 2009 20:11:16 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 72127 invoked by uid 500); 26 Oct 2009 20:11:15 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 72117 invoked by uid 500); 26 Oct 2009 20:11:15 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 72114 invoked by uid 99); 26 Oct 2009 20:11:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Oct 2009 20:11:15 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Oct 2009 20:11:13 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0D802234C046 for ; Mon, 26 Oct 2009 13:10:53 -0700 (PDT) Message-ID: <373322668.1256587853049.JavaMail.jira@brutus> Date: Mon, 26 Oct 2009 13:10:53 -0700 (PDT) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-2102) Transacted routes don't allow custom error handlers to mark exception as handled AND set rollback only In-Reply-To: <510061971.1256246152693.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c [ https://issues.apache.org/activemq/browse/CAMEL-2102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54986#action_54986 ] Claus Ibsen commented on CAMEL-2102: ------------------------------------ Its fine I used the new markRollbackOnly. Can you test the new code on your system? And if you have an unit test that you think is good to add then you can attach it. You can check the unit tests I added by the commit log and the new added tests from the source. > Transacted routes don't allow custom error handlers to mark exception as handled AND set rollback only > ------------------------------------------------------------------------------------------------------ > > Key: CAMEL-2102 > URL: https://issues.apache.org/activemq/browse/CAMEL-2102 > Project: Apache Camel > Issue Type: Bug > Components: camel-spring > Affects Versions: 2.0.0 > Environment: All platforms > Reporter: Dhiraj Bokde > Assignee: Claus Ibsen > Fix For: 2.1.0 > > Attachments: camel-spring-patch.txt > > > If a route is transacted using transacted(), and a custom error handler is registered using onException() which handles the exception using handled(), creates a custom error response, and marks the transaction to be rolled back using rollback(), Camel wraps a non-existent 'null' exception with a TransactedRuntimeCamelException in TransactionErrorHandler.wrapTransactedRuntimeException() and throws the TRCE, causing the custom error response to be ignored. > Route looks like: > // configure error handler for all routes > onException(Exception.class).handled(true).to("bean:transformerBean?method=exceptionToResponse").rollback(); > from("cxfrs://bean:categoriesEndpoint").transacted() > .choice()... > Basically the application wants to handle exceptions by sending a custom error message back to the route client, and also mark transactions for rollback. > Attached patch checks for the presence of an exception, and only raises a TRCE if its not null. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.