3

I am using tomcat 8.0.39, mysql 5.7 server and mysql connector 5.1.34 here is my context.xml config

<Resource
          name="jdbc/provider"
          auth="Container"
          driverClassName="com.mysql.jdbc.ReplicationDriver"
          factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
           url="******"
           username="******"
           password="******"
           maxActive="40"
           maxIdle="10"
           minIdle="10"
           maxWait="4500"
           maxAge="21600000"
           minEvictableIdleTimeMillis="60000"
           timeBetweenEvictionRunsMillis="5000"
           validationInterval="0"
           removeAbandoned="true"
           removeAbandonedTimeout="60"
           validationQuery="SELECT 1"
           testOnBorrow="true"
           type="javax.sql.DataSource"
           logAbandoned="true"/>

Number of connection goes upto 130 but expected 40 at max

1 Answers1

3

Tomcat has updated its default connection pooling library to Apache Commons DBCP 2.x in Tomcat 8. Tomcat 7 and earlier version used DBCP 1.x. DDBCP 2 uses maxTotal instead of maxActive to limit the number of connections. There are other notable changes also. Please read the Tomcat 8 migration guide Database Connection Pooling section.

lyn200q
  • 31
  • 1
  • 3