My current setup involves using GWT (Java to JavaScript) as the front-end, with an RPC mechanism (AJAX) to make server requests (Servlets are utilized for this purpose).
Everything has been running smoothly so far.
Recently, a test case was created which involves:
1) Sending a request to the server
2) Disconnecting the client's internet connection in between
3) Handling the InvocationException by displaying a message.
@Override
public void onFailure(Throwable caught) {
NTMaskAlert.unMask();
if(caught instanceof InvocationException){
NTFailureMessage.showFailureException(caught,"Network disconnected");
}
onNTFailure(caught);
}
4) Once the client reconnects and makes another request.
An interesting observation was made during this process.
Upon reconnection of the internet, the browser started processing the previous request again - this was noticed in Firebug. Repeating the disconnection and reconnection process resulted in the request being sent multiple times leading to data duplication.