In my previous environment, I had a dedicated MySQL install where I
could set the max connections to pretty much anything I wanted. Now I'm
moving to AWS where more connections mean a higher charge. So it's time
to get real about how many connections I really need. BTW, TC 8.5.xx.
I 'thought' I understood defining a datasource. I thought that if I set
a maxTotal of 25 it sets a fixed ceiling and the datasource pool would
never request more than 25 connections from the database. But with the
following datasource definition, mySQL shows 48 connections created.,
and JConsole shows 48 connections for this datasource. In the same
MBean panel, it shows maxTotal=25 (??). My app gets a bunch of "Server
says Too Many Connections" exceptions.
What am I missing?
<Context reloadable="true" crossContext="true" >
<Resource name="jdbc/------"
auth="Container"
type="javax.sql.DataSource"
maxTotal="25"
maxIdle="5"
maxWaitMillis="10000"
removeAbandonedOnBorrow="true"
removeAbandonedTimeout="60"
logAbandoned="true"
username="----"
password="----------"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://---------------------.us-east-1.rds.amazonaws.com
/----------" />
</Context>