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