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.
I have a Servlet that processes a request and returns a result (pretty standard stuff). However, the processing that happens can take some time, and I get a "Connection reset by peer" error message before the processing finishes. I am connection by a URLConnection, and before I get the "Connection reset by peer" error on the server, I get <URL> file not found, thworn from within getInputStream() of the URLConnection. This does not happen with shorter processes, just the longer ones. How can I set the timeout value so that my longer processes will finish? We are using Bluestone's Total-e-server (v.7.3) as the app server an IIS as the web server.
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
In your Servlet code, use the "setMaxInactiveInterval(int seconds)" method of the "HttpSession" class to set the Session Timeout Value for your server. The Servlet API says : public void setMaxInactiveInterval(int interval) Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. A negative time indicates the session should never timeout. Parameters: interval - An integer specifying the number of seconds
Originally posted by arul senthil: The Servlet API says : ...between client requests before the servlet container will invalidate this session....
Unfortunately, the problem is not with the length of time between client requests; it is in the length of time between when the client makes a request and gets a response. The client seems to be timing out (the URLConnection), and is disconnecting itself from the server (resulting in the "Connection reset by peer" error message when the server tries to send the response back to the client). IS there anyway to set the timeout in a java.net.URLConnection?