i have a servlet which will take atleast 5 mins to complete the service() method(imagine) due to some complex EIS query. i need to know one thing that if i set my session timeout period to say 1 minute and i enter the servlet what priority i will be getting. that is since i am yet to get the response from the server, my session will be active or since the time taken to cater my request takes more than the session time out interval, so my session will be getting invalidated.
i need to know one thing that if i set my session timeout period to say 1 minute and i enter the servlet what priority i will be getting.
Session timeout has nothing whatsoever to do with Thread priority. Why would you want such a short timeout? There have been a LARGE number of discussions here about how to handle time consuming queries gracefully in servlets - browse around in the last few weeks of posts. Bill
thanks for your response. actually the query takes nearly 45 mins to complete and its differs according to the user. will it be possible to cache that all!!! thats why i need to know about the session timeout priorities. kindly help me if u have any suggestion to increase the query performance. :roll:
Author and all-around good cowpoke
Joined: Mar 22, 2000
45 minutes is WAAYYYYY too long for a single request/response cycle and if the result is huge, storing it in the session is not appropriate. You will need to conduct the query in a separate Thread - maybe even a separate process, and provide some key in the session, or maybe in a longer-lived cookie for the user to retrieve the result later. What format is the result in? Bill
Yah. Don't mistake the user's browser for a client/server client program. Web browsers are "hit-and-run". The user has no real idea what is happening when they hit Submit and nothing comes back for minutes at a time. For all they know, the server crashed.
I have a project where the backend can take literally hours. Among other things, this was holding the entire Tomcat server for ransom when I ran it in the Tomcat JVM. If some other process went south, we couldn't restart Tomcat without killing the backend engine as a side-effect.
Finally ended up making the engine a separate application altogether and used RMI from Tomcat to invoke it and query for run status.
An IDE is no substitute for an Intelligent Developer.