Chris Pratt wrote:
>
> > Is there any limit on how many instances that the server can create?
> Hope
> > you can answer to my question. Thanks in advance.
>
> While there is no limit required by the specification, most servlet engines
> will impose some limit. Most are programmable.
>
To slightly nit-pick, there is a limit on the number of instances in the 2.2
spec -- if a servlet does not implement SingleThreadModel (STM), there will be
at most one instance per JVM (there is more than one JVM only in a distributed
servlet container where you have flagged your web-app with the "distributable"
tag). If a servlet does implement STM, it is up to the servlet container to
decide (usually based on configuration parameters) what the maximum number of
instances is.
Note that there is no requirement to support a pool of instances of an STM
servlet to improve performance -- there may be only one, which has the same
negative performance impact as synchronizing the doGet() and doPost() method.
In nearly all cases, STM is a *very* poor choice because it misleads you into
believing that you've taken care of all of your multithread concerns. You are
*far* better off learning how to program safely in a multithreaded server
environment in the first place.
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