I was reading K&B Head First and i came across issue of Non-Idempotent request. I want to know how the problem can be stopped. I mean, Its obvious that the user of the site would feel to click SUBMIT button more then once and if it really debits then its a BOMB for the developer.
Since, every request is given a new request / response thread, how would there be a way to identify multiple same requests from the same client that too erroneous just because the net connection was slow in responding or probably due to very bad code which takes time in responding to user request ?
This issue might also occur due to temporary link breakdown and infamous "Page cannot be found" and then user pressing the back button to submit the same request again ? I am really looking forward to know this ?
Thanks in advance,
Yogendra N Joshi.
Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....
The problem of multiple requests shows why you may want to synchronize on the Session object. The first request to grab the session object can use it to record the current state of the application. When subsequent requests can obtain access they will see that the state has already been changed.