Friday, December 26, 2014

GWT + GAE : how to handle communication failure...


I have a question concerning: how to handle communication failure...

The best way to explain my problem is to give an exemple:

In my app, the user has a gwt UI page where he creates an "item" when he has finished to fill all the requested information, he clics on a "save button" which is going to call the server using RPC:

serverService.saveBarterItem(saveItemRequest, new AsyncCallback<SaveBarterItemResult>() {
public void onSuccess(SaveBarterItemResult result) {}
public void onFailure(Throwable caught) {}

in my exemple, when everything is going ok, the server returns an object "SaveBarterItemResult".

imagine that the object that should be returned is very big in size (for exemple 3 MB).
NOW imagine the following scenario:

the client (the browser of the user) successfully reach the server.
the server (which is a GAE) save the "item" in the DB and starts returning the result.
then the internet of the client is lost....
the onFailure function is called in the browser...
which makes the user  think that the "item" has not been send successfully... (whereas in fact it has been send successfully and it has also been saved successfully)

THE PROBLEM THAT I HAVE is that I have no way to know that the item has been saved successfully on the server.
(so the normal way for my gwt app to behave would be to let the user click on the save button again... but if he does, then his item will be saved two times...)


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
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment