This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I am using tomcat 5.5, apache 2 and jk2 to connect apache to tomcat.
One of the jsp page that I am accessing in my application is taking about 2 hours to complete the process (because it is running an oracle procedure which processes an entire month's data). When I am try to access the page, it is showing the progress in status bar of the browser exactly for an hour and then showing the message 'The page cannot be displayed' after that period.
I tried setting the connectionTimeout attribute in tomcat's server.xml file to "0" but it didn't work. Later I read on the net that one has to set it to "-1" to disable the connectionTimeout. But this also didn't work.
Is there any other way to achieve this, so that connection remains open atleast for 2 hours?
There's a limit to how much you can control a browser.
For long running processes, most people use a polling page or frame.
Kick off the process
Immediately return the user to a status page.
Have the status page refresh periodically using a meta-refresh tag or JS.
When it refreshes have it check the status of the process via a variable in session or application scope or a database call.
Once the long running process is done, have it update whatever it is you're checking.
When the polling status page sees that the process is complete bring the user to the 'complete' page
This also helps the user diffrentiate between a successful kickoff of the process and a hung browser.