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

2013-11-27 Thread Arlo O'Keeffe
Jan and I further looked into the issue and actually found a working solution that is less hacky than Eric's. private void setupRequest(UserRequest request, UserProxy proxy) { final UserProxy editableProxy = request.edit(proxy); editorDriver.edit(editableProxy, request);

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

2013-11-26 Thread Jan Marten
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

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

2013-11-26 Thread Thomas Broyer
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

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

2013-11-26 Thread Jan Marten
The inconsistency with the current RequestFactory is that if in a batch request, a single sub-request has a constraint violation then onConstraintViolation is called for every sub-request and the whole batch request fails (onFailure is called). Whereas if in a sub-request an exception is raised

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

2013-11-26 Thread Thomas Broyer
On Tuesday, November 26, 2013 4:10:08 PM UTC+1, Jan Marten wrote: The inconsistency with the current RequestFactory is that if in a batch request, a single sub-request has a constraint violation There's no inconsistency, because that's not how things work. 1. All objects (entities and

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

2013-11-26 Thread Jan Marten
Thank you for clarifying the behavior. Nevertheless, in my opinion there is a use-case where the data should be reusable after a server failure. SQL exceptions like a unique constraint violation could be checked before sending the request but there might be server failures like a

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

2013-11-26 Thread Thomas Broyer
I don't disagree. A non-reachable database is likely to trigger a global failure though (in steps 1 or 4 from my previous message), that, IIRC should make the RequestContext reusable (it does in some cases, I just can't remember which ones) That said, you could also handle the error on the

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

2011-09-06 Thread Kevin Jordan
I'm running into this issue too. It seems when the server throws an exception it gets sent to the individual Request not the fail() method in the RequestContext. So reuse() is never called from it in the case of a server exception. I'm not sure why they designed it this way. A server

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

2011-09-06 Thread Eric Andresen
Kevin, My solution was to make copies of both RequestFactoryServlet and SimpleRequestProcessor in a com.google.web.bindery.requestfactory.server package in my environment, and then inside MySimpleRequestProcessor.process(), add the following change: . . . assert

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

2011-09-06 Thread Thomas Broyer
RF invocations are batched in a single HTTP request, but there's no implied transaction. You're free to use a transaction-per-HTTP-request scheme, or a transaction-per-invocation one (or no transaction at all). So when an invocation fail, RF doesn't assume the whole batch can be sent again.

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

2011-08-01 Thread Eric Andresen
It looks like the onFailure case only unfreezes the context in the case of onTransportFailure or response.getGeneralFailure, not in the case of an invocation failure. I tested this, and the context is still locked and the beans still frozen when my onFailure callback is called. I guess I'll

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

2011-07-29 Thread Eric Andresen
Hmm, I tried going down the onViolation / onFailure paths, but ran in to other problems with those. For onFailure, is there a way to send a valueProxy back inside the exception payload? It looks like the default behavior is just to extract the message out of any thrown exception. I'd like to

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

2011-07-28 Thread Eric Andresen
Does anyone know of a way to perform the following scenario? 1. Retrieve an EntityProxy 2. Edit the proxy in an editor 3. Submit the changes using a Request Context 4. The server call is rejected due to a server-side validation failure 5. Make some more changes to the proxy 6.

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

2011-07-28 Thread Thomas Broyer
On Thursday, July 28, 2011 11:55:54 PM UTC+2, Eric Andresen wrote: Does anyone know of a way to perform the following scenario? 1. Retrieve an EntityProxy 2. Edit the proxy in an editor 3. Submit the changes using a Request Context 4. The server call is rejected due to a