camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: 答复: Is this a bug of try-catch or transaction?
Date Thu, 22 Apr 2010 08:56:22 GMT
How about using the onExeption[1] ?
It works within the ErrorHandler, and it can do the same thing as 
doTry... doCatch does.

[1]http://camel.apache.org/exception-clause.html

Willem

ext2 wrote:
> Thanks Claus Ibsen:
> 
> If we just consider this example, move policy before doTry could resolve it; but If we
 consider another situation:
> 	<doTry>
> 		..some other operation ..
> 		<policy ref="...>
> 			transaction operations
> 		</policy>
> 		<docatch>
> 		</docatch>
> 	</dotry>
> 
> At this time, I cannot move policy to <doTry/> easily; and also, if transaction
operations  raise exception, the doCatch cannot catch it;
> 
> 
> Claus Ibsen wrote:
>> Move the <policy> before the <doTry>
> 
> 
>> On Thu, Apr 22, 2010 at 9:08 AM, ext2 <xuhb@tongtech.com> wrote:
>>
>> Hi:
>>
>> The camel's transaction required the transacted-error-handler, but try-catch
>> required no-error-handler. They will conflict; following is a sample that
>> the try-catch cannot works while using transaction. but I am not sure if
>> this is bug or just a camel's limit?
>>
>> For example, the following route :
>>
>> <doTry>
>>        <policy ref="PROPAGATION_REQUIRED">
>>        <pipeline>
>>     <to uri="ibatis:table.add?statementType=Insert"/>
>>     <bean ref="errorbean" method="raiseError"/>
>>     </pipeline>
>>     </policy>
>> <doCatch>
>> <exception>java.lang.Exception</exception>
>> <bean ref="mybean" method="foo"/>
>> </doCatch>
>>
>> As for normal understanding: the errorbean(just after ibatis) raise error,
>> so the pipeline will marked as rollback status, but the exception is still
>> exist, and the catch clause will be execute.And in camel, doCatch cannot be
>> execute;
>>
>>
>>
> 
> 
> 


Mime
View raw message