Welcome to the JavaRanch.
Originally posted by Sarath Jonnalagadda:
It is an immediate requirement.
First,
Ease Up. Everyone's post here is "immediate", at least to them.
Next, it's a bad idea to use web server threads to perform long-running tasks. Web servers are designed to handle multiple short-lived HTTP communications, not hours-long batch jobs. Even if you make the session timeout huge, you still have to deal with other issues, like TCP/IP socket timeouts, firewall issues, browser timeouts and so on.
The typical solution in this case is to hand the long-running task off to another server designed for this task and let it run asynchronously. The HTTP request returns immediately. Either the user can be informed of the task completion with an email that contains a link to the results, or a waiting page can be displayed that refreshes at an interval. A task number stored in the session can be used to query the asynchronous task status.
[ September 19, 2008: Message edited by: Joe Ess ]