Here is my view:

    Create a seperate DBManagerServlet  to maintain database connection pools. Put
the open connections and setting up the pool code inside the init() method.  When
Login servlet is invoked the , it should request the DBMServlet for a connection.
DBM would just pull one connection from the pool and return it.  (Login Servlet has
to get a reference to the DBManagerServlet and request for a connection). It should
be possible to configure your servlet evngine to start only one instance of the
DBManagerServlet. You can also create the pool manager class as a singleton object
so only one instance is created.

Thanks
Santhosh


Nanduri Amarnath wrote:

> Hi everybody,
>      I am using a LoginBean as a Session Object in my JSP pages.   The LoginBean
> takes user info and connects to a Database (where it validates the username and
> password).  I am using a ConnectionPool to maintain a pool of connections to a
> Database.  I am creating the ConnectionPool inside the constructor of the
> LoginBean.
>
>      My question is... If some 10 clients use my app.. will 10 ConnectionPools
> be created ? If so, how can i overcome this to maintain only a single connection
> pool and have all my LoginBeans (sessions) access that pool.
>
> Forgive me if i am wrong...but i was under the impression that only a single
> LoginBean will be created on the server and all the JSP requests access that
> bean. If this is the case, then how can i maintain sessions for all the
> different users ?
>
> In servlets i used the  init() method to create my ConnectionPool. Is there
> anything like this method, that i can use in the JSP to create my ConnectionPool
> ?
>
> Thank you very much for your feedback.
>
> Cheers,
> Amar..
>
> [EMAIL PROTECTED]
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to