You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Bob Morley <rm...@emforium.com> on 2008/12/16 18:00:48 UTC

ServiceDispatcher does not rollback on failure

In the runSync method on the ServiceDispatcher it looks like the finally
block will only rollback the transaction on an "error" and not on a
"failure".  Is this correct?  I would have thought we would rollback the
transaction if either of these are true.

Tiny code snippet:

            } finally {
                // if there was an error, rollback transaction, otherwise
commit
                if (isError) {
 ...

-- 
View this message in context: http://www.nabble.com/ServiceDispatcher-does-not-rollback-on-failure-tp21037143p21037143.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.


Re: ServiceDispatcher does not rollback on failure

Posted by Bob Morley <rm...@emforium.com>.
Ahhh -- so this implies that the error is "harder" than a failure then?  This
seems to imply that you want to use a failure when you have done some work
you want to persist, but the operation itself was not completely successful? 
Would that be a fair statement?



That is actually why the "failure" return was introduced. It is  
distinguished from "error" in that it does not cause a transaction  
rollback.

-David

-- 
View this message in context: http://www.nabble.com/ServiceDispatcher-does-not-rollback-on-failure-tp21037143p21037799.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.


Re: ServiceDispatcher does not rollback on failure

Posted by David E Jones <da...@hotwaxmedia.com>.
That is actually why the "failure" return was introduced. It is  
distinguished from "error" in that it does not cause a transaction  
rollback.

-David


On Dec 16, 2008, at 10:00 AM, Bob Morley wrote:

>
> In the runSync method on the ServiceDispatcher it looks like the  
> finally
> block will only rollback the transaction on an "error" and not on a
> "failure".  Is this correct?  I would have thought we would rollback  
> the
> transaction if either of these are true.
>
> Tiny code snippet:
>
>            } finally {
>                // if there was an error, rollback transaction,  
> otherwise
> commit
>                if (isError) {
> ...
>
> -- 
> View this message in context: http://www.nabble.com/ServiceDispatcher-does-not-rollback-on-failure-tp21037143p21037143.html
> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>