• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

request time out

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am currently facing a problem with a web application I am supporting.
I actually need to create and show pdf report that is based on the extract of a large amount of data. The extract of the data takes some time and then its formatting and conversion into a pdf report also takes quite some time. The problem is that while the application is doing so, the request times out (currently 2 mins) and the user is takes to a error page.
So we are exploring two options to avoid this problem.
1) Create a new thread from the servlet's service method which will do the processing for the extract of data and its conversion into a pdf report. And while this is happening, we can send a response to the user.. maybe to a jsp showing the status of the report. When the report has been generated by the separate thread, it will also create a Marker file. The page that was loaded will keep checking for the existence of the marker file. When found, it will load the report into the browser. The process of extract involves calls to EJBs which give calls to methods to connect to database using connection pool, and then extract the data. The pdf is created using third party java API.
My question is that is there any reason why this should not be done... beacause it is usually said that new threads should not be created from servlets. What are the pitfalls of doing this ?
2) Are there any problems with increasing the request time out parameter to say 15 minutes. The report will be generated in that much time comfortably and no error page will be shown to the users. We are using WAS 3.5
3) Is there any other approach that anyone will like to suggest for this issue ?

Regards,
Anupreet
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the plugin is timing out the connection. try setting the below variables in the webcontainer - HttpTransport
ConnectionIOTimeout - 60
ConnectionKeepAliveTimeout - 60
Defn
ConnectionIOTimeout
This is the maximum time (in seconds) to wait when trying to read data during the request. The default value is 5 seconds. This timeout determines how long to wait to read at least one byte of data.
ConnectionKeepAliveTimeout
This is the maximum time to wait for the next request on a KeepAlive connection. The default value is 5 seconds. If the next request on this KeepAlive connection is not received within this time, the connection will be closed.
 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have done this same thing before and right or wrong, I did about the same way you are suggesting here. It worked and that is about all I can tell you.
 
Anupreet Arora
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vinod,
I think the plugin is timing out the connection.
Plug in for what causes this ? Pdf files ?
Hi William,
What worked fine, the 1st solution my mail or what Vinod here has suggested?
Best Regards,
Anupreet
 
Anupreet Arora
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vinod..
Are these properties available for WAS 3.5 ? Because I can't see a tab for webcontainer in my console.
Regards,
Anupreet
 
Where all the women are strong, all the men are good looking and all the tiny ads are above average:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic