Hi,

You can reduce this problem to a very good extent by working on
following tags in your web.xml:

<parameter>
      <name>maxActive</name>
      <value>100</value>
    </parameter>
    <parameter>
      <name>maxIdle</name>
      <value>20</value>
    </parameter>
    <parameter>
      <name>minIdle</name>
      <value>10</value>
    </parameter>
    <parameter>
      <name>maxWait</name>
      <value>700</value>
    </parameter>

You can get the details from Tomcat Documentation.

Regards,
Razat Gupta.



-----Original Message-----
From: Manisha Sathe [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 24, 2005 2:27 PM
To: users@tomcat.apache.org
Subject: Connection problem (Too many connections) for MySQL 4.1

I am on Tomcat 5, MySQL 4.1 and using JNDI. The
context xml is as follows
..

<ResourceParams name="pool/connectDB">
    <parameter>
      <name>factory</name>
     
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>

    <!--MySQL - connection related params-->    
    <parameter>
      <name>initialSize</name>
      <value>10</value>
    </parameter>
    <parameter>
      <name>maxActive</name>
      <value>100</value>
    </parameter>
    <parameter>
      <name>maxIdle</name>
      <value>20</value>
    </parameter>
    <parameter>
      <name>minIdle</name>
      <value>10</value>
    </parameter>
    <parameter>
      <name>maxWait</name>
      <value>700</value>
    </parameter>

....
After a while i get error from MySQL 'Too Many
connections' When i try 

mysql>show processlist; 

from mysql command it shows me more than 100
processes. But almost all  with 'State' Sleep.

I am properly closing all conneections/reultsets. The
mysql process state also shows the 'Sleep' but then
still why it is not getting reused? 

It seems everytime new connection is taken from mysql
and existing connection is not re-used.

Is there any setting am i missing? 

Thanks in advance,

regards
Manisha




        
                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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




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

Reply via email to