-----Original Message-----
From: Nick Polyak [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 02, 2001 10:21 AM
To: [EMAIL PROTECTED]
Subject: several tomcat questions


Hi,
I am new to tomcat, so, please forgive the naiveté of my questions.
I am using Tomcat 3.2.
1. Is it possible to create a db connection pool inside Tomcat? If yes, then
how. 

Yes.  Create a class that holds on to db connections and allocates them out.
There are several implementations out there of this type of thing.  One
fairly popular one it PoolMan avalable at
http://poolman.sourceforge.net/PoolMan/index.html. 

 
2. How can I create a servlet pool, with the specified number of servlets
initialized at the start up time and the possibility to grow in case more
servlets are required to handle the load. 

My first question is why?  Tomcat creates one instance of a servlet for all
requests (assuming SingleThreadModel).  This means that you shouldn't be
creating pools of servlets.  I don't know what Tomcat does for
multi-threaded servlets, but you could look at the source code.

 
3. How to I switch between single and multi-threaded servlet models using
the Tomcat configuration parameters?


According to the servlet spec, your servlet needs to implement the
SingleThreadModel to guarentee that only request at a time accesses your
servlet.  MultiThreaded is the implied default when SingleThreadModel is not
implemented.  (Spec is available from the JavaSoft website.)


        Randy

Thank you
Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to