tags:

views:

508

answers:

3

Hello,

I have long HTTP request ( generating large Excel file - about 60K records or so) which takes like 5 minutes to complete. The wheel with icefaces shows connection is dead and although the file is ready on the server, ICEFaces page is dead and I have to refresh it and can't get the file! How to about extending timeout I tried the following in web.xml but it didn't help:

Code - Web.xml:

 .....
 <context-param>
         <param-name>blockingConnectionTimeout</param-name>
         <param-value>600000</param-value>
 </context-param>  
 <context-param>
         <param-name>synchronousUpdate</param-name>
         <param-value>false</param-value>
 </context-param>
 <context-param>
         <param-name>connectionTimeout</param-name>
         <param-value>600000</param-value>
 </context-param>
 <context-param>
         <param-name>heartbeatRetries</param-name>
         <param-value>20</param-value>
 </context-param>
 <context-param>
         <param-name>heartbeatInterval</param-name>
         <param-value>400000</param-value>
 </context-param>
 <context-param>
         <param-name>heartbeatTimeout</param-name>
         <param-value>2000000</param-value>
 </context-param>
 .....

Any ideas?

Thanks,

Tam

+1  A: 

Seems to be a client timeout! Try async creation with ajax response.

Martin K.
Yes it is client timeout. How to do Async Creation? could you please provide pseudo code
Tam
1. Create a ajax request which does the excel file processing with a unique id.2. Replace the request button with a spinner icon (or a loading icon). If you are sure that the processing time is nearly 6minutes everytime, add a countdown (approx. 5,4 min...) 3. Write a servlet which returns if the file processing was successful. (id as parameter)4. Let the page from where you start the processing call this "check" servlet with the given id every X seconds. If the cration was successful you can provide a link to a page which displays the file.It's done ;) No more timeout problems.
Martin K.
A: 

Try setting the buffer size to an increased value to prevent unneccessary handshaking between client/server.

<context-param> 
  <param-name>facelets.BUFFER_SIZE</param-name>
  <param-value>500000</param-value>
</context-param>

web.xml

You'll find a lot of positive feedback from people who increased their JSF performance drastically with this little switch. Maybe it will help in your situation, too?

Gerhard Dinhof
Thanks for the comment...I tried it it didn't help :(
Tam
A: 

Without knowing more about the problem, here's the approach I would take:

  1. User clicks on link to generate excel file. Display some message in place of the link such as "Processing..."

  2. Periodically (maybe every 3 sec) ask the server if the file has been generated, if not wait a few seconds and ask again.

  3. Once the file is finished generating, change the "Processing..." text to a link to the file "Download yourfile.xls" which has been generated and stored on the server in a download area.

This way the browser isn't stuck waiting for the file to be generated.

Nicholas Smith