tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Session timeout during method execution
Date Wed, 31 Jan 2007 17:02:14 GMT
Hash: SHA1


Bryan Basham wrote:
> Did you know that you have programmatic control over the
> session timeout[?]  Simply call the setMaxInactiveInterval method
> on the HttpSession object with a value in seconds.

This is the method the OP is already using, and it does not appear to
work. The OP tried session.setMaxInactiveInterval(-1), which is
documented to turn off session timeouts altogether (but I wouldn't

> Caveats:  You will need to reset the inactive interval back to
> five minutes when the request has completed processing or
> this value will be used for the rest of that user's session.

This was done by the OP in the initial attempt.

> Second caveat: Have you verified that the browser or server
> will not "timeout" during this long request cycle?

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.

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).

- -chris

Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message