This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
On the 1st submit, the request is processed since the token is valid. While the server is processing the 1st request, (I used a Thread.sleep(10000) to simulate a long transaction), the request is submitted a 2nd time. According to my codes, the request will not be processed as the token is not valid.
However after successful processing of the 1st request (Thread.sleep(10000) ends), my servlet which is supposed to forward to a JSP to display the results of the transaction, will throw a java.io.IOException: There is no process to read data written to a pipe.
I read from IBM's technote that this message is thrown when the client pressed Refresh, Back or Stop, or close their browser after making the request, but before receiving the response back from the server.
In this case, none of the buttons were pressed. It was simply a 2nd click on the submit button before the 1st click had completed processing. Has anyone encountered this problem before? Or has anyone successfully implemented the prevention of double submissions? I've tried almost everything I've read from the forums but it doesn't seem to be working.
I think it's the same problem IBM described even though they didn't list doing another GET or POST as a possible cause. I can induce the problem in my WikiServer by doing very fast GETs. I have to tap-dance on the refresh button to get fast enough but you've got that 1 second sleep to simulate longer response time.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi