I'm using
Tomcat 7's connection pool with MySQL.
Testing my application, it doesn't reuse anything from the pool, but ends up creating a new pool, to eventually where I cannot use the database because there are hundreds of sleeping connections in the pool when the max active size for the pool is set to 20.
See here for reference:
It creates exactly 10 for each request, which is the minIdle attribute as seen below.
Here is the sample test code embedded into a
jsp page. The code is not the code in my application and just used to see if the issue was with my code, but the problem still persisted.
Here is my context.xml file:
I'm sure I can use removeAbandonedTimeout to a low number and it would purge all these sleeping connections, but that wouldn't fix the real problem would it? Does anyone know what I'm doing wrong?
Thank you very much,
Ben