Hi Shravan,

I've recently had the same situation and we solved it thus :

Encapsulate the lengthy process in an object that implements Runnable, 
complete with an isFinished() call.  Start a seperate thread to execute this 
and place the object in the httpsession.  Send a page back to the user with, 
say, a 5 second refresh which updates the user on the status of the process.

It's not ideal, as it is a form of polling, but it gives the opportunity for 
user feedback.  We cached the last 5 processing times and could give an ETA 
to the user based on the mean.


Jon.

On Monday 23 April 2001 08:13, Shravan Shashikant wrote:
> Hi there,
>    I have a problem with a certain servlet code of mine which takes a lot
> of time to execute.The problem is that since it takes a lot of time to
> execute,the browser times out the servlet after say 5 minutes.I heard
> somewhere that this can be remedied by using out.flush() for the output
> stream;that didnt work and i learnt later that the problem is actually
> with Apache which buffers output in 8k units.I was wondering whether this
> setting could be changed or if there were any other solution to this
> problem.I looked at certain threading issues but am generally
> uncomfortable using the meta header and refreshing it every 10
> seconds,till the thread of the task is completed.
>   Also,found out that we can increase the timeout for the apache web
> server by changing the httpd.conf file.But is there anyway to reduce the
> output buffer size?
> Thanks & Regards,
> Shravan

Reply via email to