ServiceDispatcher does not rollback on failure

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ServiceDispatcher does not rollback on failure

Bob Morley
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) {
 ...
Reply | Threaded
Open this post in threaded view
|

Re: ServiceDispatcher does not rollback on failure

David E Jones-3

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.
>

Reply | Threaded
Open this post in threaded view
|

Re: ServiceDispatcher does not rollback on failure

Bob Morley
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?

<quote author="David E Jones-3">

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

-David