Tuesday, November 26, 2013

Re: Re-firing a failed/rejected server call in RequestFactory, is this possible?



On Tuesday, November 26, 2013 1:56:35 PM UTC+1, Jan Marten wrote:
Is there any progress on this issue?

Issue https://code.google.com/p/google-web-toolkit/issues/detail?id=5794 is related and is not fixed either.

RF's behaviour in this regard is inconsistent since an "unimportant" retrieval would fail on any ConstraintViolation
in batched requests. It should definitely be possible to batch requests but the current API is not sufficient.

A recommendation would be to pull batching out of the RequestContext interface and expose it in e.g. a RequestContextBatcher.
A RequestContext is used for one request only and is reusable on failure or violation. Thus removing append(), fire(Receiver), etc.
RequestContextBatcher is used for multiple requests.

The specific behaviour in onFailure and onViolation should be discussed further.

The current API has batching built-in: one RequestContext instance == one batch request. You're free to use batches that only contain a single invocation.
 
Transaction settings might make it necessary for all RequestContexts to be re-executed or to only re-execute the failed/violating requests.
Therefore it must allow customization by the user.

RF assumptions are that:
  • for a given HTTP request, there's only one instance for each entity (an entity shouldn't have 2 instances in the same request handling; see https://code.google.com/p/google-web-toolkit/issues/detail?id=7341). That generally means using "cache" scoped at the request, which translates to using the "session per request" (aka "open session in view") pattern.
  • there's one transaction for each "service method", so that each one can fail independently of the others. If that's not what you want, then create a specific "service method" that does all your work that should be executed in a single transaction.
This is not going to change (what might change is the restriction that one proxy can only be edited by a single RequestContext at a time, which is discussed in the issue you linked to)

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment