On Sunday, February 20, 2011 3:26:35 AM UTC+1, Colin Alworth wrote:
>
> I think you are addressing the wrong issue – Scott is pointing out that 
> general exceptions do not allow you to re-fire contexts after modifying the 
> proxies further.


Given his last message, about clearing 'invocations' but not clearing 
'editedProxies', I think I was understanding correctly: I understand it as 
"I want to be able to fire the same context again, so the edits made to 
proxies are not lost, but I have to clear invocations otherwise, because 
I'll enqueue my invocations again, my service methods on the server side 
will be called twice".
 

> The r/o proxy instance is stuck as read only because there still exists a 
> context-specific edited copy of it, which did not succeed and has not been 
> cleared.
>
> The context clears itself in the case of failure or validation error, but 
> not in the case of general failure, Scott is suggesting (and I think I 
> agree, admittedly without having tried this use case) that this is a 
> mistake, and that general transport failure should be treated as something 
> that can be retried.
>

I'm reading the code in trunk@9753 but I believe there hasn't been much 
changes since 2.2 (apart from the refactoring when introducing JsonRpc 
support):

   - onTransportFailure, fail() is called, which calls reuse(), so the same 
   context can be fire()d again.
   - on general failure, fail() is called too
   - on violation, violation() is called, which calls reuse()

reuse() unfreezes the proxies that have been edit()ed in this context, so 
you can edit them further (in the same context), and unlocks the context (so 
you can fire() it again).

This means that on transport failure and general failure, you can just call 
fire() again to retry. And on violation, you can fix the errors and then 
fire() to try again.

In case of "non general" failure though, the onFailure method of the 
associated invocation's Receiver will be called but everything else will be 
as if all was OK (the context-level Receiver's onSuccess is called, the 
context is still frozen so it cannot be reused, and editedProxies is cleared 
so the proxies can be edit()ed in other contexts).

Am I wrong in my reading and understanding of the code?

>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to