Joe Lei wrote:
> Dear Wisers
>
> I've a question on SingleThreadModel Servlet.
>
> In a non-SingleThreadModel, Servlet instance need not to be reloaded (or killed)
>until the engine restart or old version of servlet is replaced.
>
> How about servlet implements SingleThreadModel, is the servlet instance being clean
>up after the invoked thread stops? If not, does it mean the no. of servlet instance
>remains in the highest watermark of the instances invoked?
> (For example, if 10 instances has been invoked in earlier time at the same instant,
>even though only 5 users is now connected, the no. of servlet instance still remains
>in 10?)
>
In all servlet containers, for all servlets (SingleThreadModel or not), the servlet
container has the right to destroy existing instances whenever it wants to. For
example, servlet engines that implement automatic reloading when
a servlet's class file has changed will destroy the old instance before creating the
new one.
For STM servlets, many servlet containers maintain a pool of available instances. The
container again has the right to create and destroy instances according to the
policies you have configured. Note that this has absolutely
nothing to do with the number of users that are "connected" because there really is no
such thing -- HTTP is a stateless protocol. Usually, the pool is defined by
configuring the minimum and/or maximum number of instances to be
created.
For specific policies about when existing instances are destroyed, you need to check
the docs on the servlet container you are using.
>
> Thanks
> Joe
>
Craig McClanahan
___________________________________________________________________________
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