Hello Friends,
I need some clarification.
I tried the following thing
I wrote a servlet which extended HttpServlet and implemented
SingleThreadModel
In the init method of this servlet I put a display statement just to
find out how many times it gets called i.e how many instances of this
servlet would get created.
Then I invoked this servlet thru an HTML page. The display statement was
shown 6 times which means that the server created 6 diff. instances of
the same servlet. Am I right? How was this figure of 6 reached at?
How is this pool of instances used by the server? I then invoked the
servlet more than 6 times and then expected the server to create some
more instances to satisfy the additional requests however this did not
happen. The server seamed to reuse the existing pool because it seems
that the servlet after having sent back the response becomes free to
handle new requests.Is this right?. The server then searches thru the
existing pool to find out if any servlet instance is free to handle to
new request or not.
Also in this scenario the database connection got established 6 times.
Is there any way to establish the database connection only once but
still use SingleThreadModel
Any help will be appreciated
Thanks
Nitin
___________________________________________________________________________
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