Tomcat has a database connection pool (DBCP) to make requests faster.
In my app, too many connections are being used for too long, I suspect a leak (connection not being properly closed) and I need to find out where is the leak.
QUESTION: How to find out the name of each thread which is using a connection?
Preferably live JMX MBean, but other tips are welcome too. Showing each thread's stack trace or class name would be acceptable too.
Note: I am not looking for an MBean that shows the DBCP settings. I want to see what uses each connection.