> Marian Haus wrote:
>
I'm not sure exactly what you're trying to do, so
I'm going to guess about the problem and your
experience level. I might have guessed wrong, and
you might already know all of this.
> During a browser session I want to get the data from the
> database and then save the data into a buffer. I'm ...
> saving the data into the buffer using session.setAttribute()
>
As long as you need different data for each session,
that's the way to do it. fine. Just be aware that if
you have a large number of sessions, you're going to
use up a lot of memory.
If the data is relevant to all sessions, then you
can put it in the ServletContext instead.
> I can set the timout of the servlet using
> setMaxInactiveInterval()
>
This is the timeout for the session, not the servlet.
The servlet javadocs provide a good explanation:
"Specifies the time, in seconds, between client
requests before the servlet container will
invalidate this session."
In other words, if a client doesn't send a request
for that number of seconds, the container will
end the session.
> I've noticed that the servlet thread has a "Idle
> Thread Timeout" with the default value 300 seconds
> (I am using JRun).
>
This is something completely different. It's just
a tuning parameter that has to do with the internal
operation of JRun. Are you sure you really care
about it?
> Actually the question is how can I find out (or
> manage) if the thread of my servlet is destroyed
> or not?
>
Well, first off, your servlet doesn't get a
thread of it's own, it just sort of borrows one
from the container in order to run its service()
method, right? But the container lets it keep the
thread for as long as it wants. (that's what the
idle thread param is all about, but read the jrun
docs for details)
The only thing you need to worry about is that
the client web-browser also has a timeout, so
if your servlet takes too long, your user will
get an error message from the browser (because
the browser thinks the server has died)
--
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html