Hello all.,

I am trying to create my own connection pool (ref Jason Hunters Book
pnos 266-268) and invoking it from a servlet.  Following is thecode
snippet for connection pool.

The following block is the one whichmakes the entire connection and i am
calling it in the constructor of a class called DatabasePool.

Pooling Class File
---------------------
 public DatabasePool(){
   makePool();
 }

 public void makePool(){
  System.out.println("Coming to pooling");
  for(int i=0; i < pri_Dbcount; pri_Dbcount++){
   try{
     Class.forName(prws_Driver);
     prv_Connections.addElement(DriverManager.getConnection(prws_Dburl,
prws_Usrname, prws_Password));
   }
   catch(SQLException sqle){
    System.out.println("Sql error in Pooling:" + sqle.getMessage());
   }
   catch(ClassNotFoundException cnfe){
    System.out.println("Class exception:" + cnfe.getMessage());
   }
  }
  System.out.println("Leaving the pooling");
 }

In my servlet i am doing the following:

Servlet
----------
public class Queryservlet extends HttpServlet{
  private DatabasePool dbpool;

public void init(ServletConfig config) throws ServletException{
   super.init(config);
   dbpool = new DatabasePool();
 }

When i invoke this servlet thro an HTML nothing is happening and when i
see my task manager cpu process is reaching 100%.  I can find only 1
reason for this cpu 100%, after i stop the browser or quit the browser
still the servlet is trying to processing the request which is amounting
in this huge traffic.  What might be the problem with my servlet and
connection pooling.

Environment
=========
jsdk2.1, jrun2.3, nt4.0

Expecting the help from list,.
Srini

___________________________________________________________________________
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