Hi,
  I suppose u have kept the class files of connection pool
  in path where the servlet class loader is pointing to.

  make sure that u have kept the connection pool in the JVM classpath
  but not in the  servlet directory or in the servlet class loader
  path.

  Most of the connection pools are designed to be used as singleton,
  and u should make use of this property.

Hope this helps
H.M.Mallik


>>>SAN Wrote..
>
>When I thougth my problems with connection pools had finished, I realise
>that it doesn't do what it's supposed to do. (Probably because my code
>isn't very good) OK, here goes the pseudo-code:
>
>In each servlet:
>
>Connection con =null;
>Pool pool = null;
>init()
>{
>     pool = Pool.getPool();
>}
>service(){
>con = pool.getConnection();
>
>// use con
>
>pool.returnCon(con);
>}
>
>And the pool:
>
>class Pool() {
>    static private Pool instance = null;
>static synchronized public Pool getPool() {
>
>         if(instance==null) {
>            instance = new Pool();
>         }
>         return instance;
>   }
>
>private Pool() {
>     ...
>}
>
>The problem is that a pool is created for each servlet. As you can see,
>if the instance is not null, getPool() returns a created one. But the
>constructor is ALWAYS executed when I call a new getPool(). Once the
>pool is created, it serves connections to ITS own servlet (which is not
>too useful). What happen? The instance variable is static, so should be
>shared within the virtual machine.
>
>Any idea, corrections, whatever ?
>Thanks.



_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com

___________________________________________________________________________
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

Reply via email to