jpp1jpp1
jpp1jpp1

Reputation: 181

GWT-RPC timeout expired

Scenario: Users are writing data to my webapp/DB sometimes using mobile devices with a bad comm.link (GPRS)

As i don´t want duplicate data, there's no timeout in their write request but this means sometimes they are waiting long time for the asych callback to arrive.

Through RpcRequestBuilder, I can add a timeout to the RPC request but if it expires, is there any way to know if the data was stored and it was the response that was lost of if even the request didn't reach the server?

If it's not the only way I see to achieve this is through unique constraints in my database.

Ty in advance

Upvotes: 1

Views: 1489

Answers (2)

Alaa Murad
Alaa Murad

Reputation: 166

This state should be called, the UNKNOWN state. You will always face this issues when developing Client/Server and multi tier application, not only Timeout, but also some poor error handling in the server side. You need to categorize your calls to the server, I do like this, Transaction, Inquiry and Important. Transaction is what is happening in your case (something will be changed or updated in the server) in case of this type of failures for those type of calls, I inform the user that we lost connection while processing his/her request, and I also inform him/her that he/she need to double check the transactions before trying to re-execute again (if you have Primary Key or Reference, you can do this checking in behave of the user ). For the Inquiries calls, I just ignore and call again, for the last type, it's usually Inquiry but with it's important for the application to work, so I deal with it differently.

This is why it's important to have the concept of categorizing your calls.

Alaa

Upvotes: 0

jusio
jusio

Reputation: 9910

If request failed with timeout, the only 100% way to know if it were able to save payload data, is to send another request and see if the data were saved correctly.

Upvotes: 1

Related Questions