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.
Hi people, I was working on a problem where I have to let the users know that their database query and/or session is going to timeout and they are going to get a "page not found" error. What can I do in the servlet to capture that the page is not going to return and let the users know. Thanks, Rajesh
You will have to run the database query or whatever the time consuming operation is in a separate Thread - presumably in something like a JavaBean that implements Runnable. Keep in mind that servlets only respond to requests and can't just arbitrarily send a page. Bill
Joined: May 13, 2003
Thank you, I just needed a little more clarification. If I run the query in a seperate thread, then it will not time out and keep running in the background (say for half an hour) and in the meantime I can display to the user that his report is executing and he should wait. I have an option where the user can get the web report by email too (am using a seperate thread). So now that the web report never times out, the only thing I can do is to calculate the time at regular intervals and if it exceeds a certain time, display to the user that it is taking too long and maybe he should try email instead. Please let me know if I am missing something. Thank you, Rajesh
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com