Hi,

  How do you get JDBC Connection, named 'conn'?
  It is from Driver Manger or Connection Pooling Utility?

  Is 'conn' variable auto variable of method or instance variable of JSP?
  Generally, JSP is called from multiple threads.
  Do you lock 'conn' variable by synchronization?

  I suggest we use try-catch-finally block to close resources related to
database, and watch whether 'conn' is closed with debug message as below

  synchronized(conn) {
    try {
      ...
    }
    catch(Excpetion ex) {
      ...
    }
    finally {
      try{
        conn.close();
        System.out.println("closed!!");
      }
      catch(Exception ex){}
    }
  }
  

Thanks.

yilmaz wrote:
> 
> Hi takashi,
> My environment is :
> Win2000, jdk1.3,  tomcat 4,
> Well, i am sure i added a snippet which closes statemnt and the connection.
> for example, below is the snippet from one of my pages content.jsp :
> 
> <% if (stmt!=null) { // actually this is a curly left brace
>   stmt.close(); }  // actually this is a curly right brace
>   if (conn!=null){ // stmt is a Statement object
>   conn.close();  //  conn is a Connection object
>   } %>
> 
> whenever i call this page , number of connections inreases by one
> it seems that the connections can not be closed
> Any idea or suggestions ?
> thanks a lot in advance
> best regards :)

-- 
TAKAHASHI, Tomohiro

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to