tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Rhoden <ja...@rhoden.id.au>
Subject Re: Session timeout during method execution
Date Wed, 31 Jan 2007 23:29:34 GMT
Christopher Schultz wrote:
> This was already pointed out (by me, in fact). Sometimes, you can trick
> the browser into keeping the connection open by sending data back little
> by little. For instance, I think you might be able to keep the
> connection open by sending HTML comments like "<!-- still processing
> request -->" every so often. I've never tried it, but it might work.
>
>   
This does work, but there is a limit to how long you can keep the 
connection open. I have a report which outputs a line in the html table 
every 5 seconds, from the users perspective it seems more responsive 
because they start seeing things straight away, but after about 30 
seconds the browser closes the connection. (I don't know the exact times 
but IE keeps the connection open shorter than firefox).

> The best strategy for long-running requests is to have the
> background-processing occur in a separate thread and have the user's
> browser make regular requests to see if processing is complete. This
> solves the session timeout problem (just have the browser re-request the
> "update" page every 60 seconds or so and the session won't time out) and
> the browser timeout problem (since you aren't waiting for 10 minutes for
> data to come back).
>   
Yes this is the best way!

Best Regards,
Jacob

_________________________________________________
Jacob Rhoden -- http://www.jacobrhoden.com/



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message