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


On Friday, February 18, 2011 6:01:14 PM UTC-6, Thomas Broyer wrote:
>
> I think it was on-purpose: validation is done before any invocation is 
> processed, so you can safely send the same invocations back to the server 
> after making changes to the proxies so they validate the next time. I guess 
> the idea is that you then only change proxies and fire the context again, 
> without enqueueing your invocations once more.
>
> Failures however can happen at any time during invocations processing. 
> Clearing invocations would work in many cases, but not all: you'll send the 
> same operations, but the domain objects might have change as a result of a 
> previous successful invocation (RequestFactory doesn't make any assumption 
> on the use of transactions, so things have not necessarily been rolled back; 
> actually in your case, our datastore –MongoDB– doesn't have that concept of 
> transaction, and we successfully use RF with it; and similarly, AppEngine 
> transactions are so specific that you won't enclose your whole RF request in 
> a transaction), so applying the operations might very well fail (e.g. entity 
> has been deleted, or its state has changed so that a setter now throws an 
> exception).
>
> You'd probably rather want to copy the edited entities to another context. 
> I haven't checked but it might be possible using AutoBeanUtils.getAutoBean 
> and AutoBean.clone before a context.edit().
>
> See also http://code.google.com/p/google-web-toolkit/issues/detail?id=5794
>

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

Reply via email to