What is a good tool for the investigation of Database Connection usage in Java?
A developer is supporting a complex Java program which is ocassionally exhausting the number of Database connections available. Since the problem is sporadic it would be useful to know which thread has opened multiple connections to the database to focus the effort in this area.
In the end, the correct fix seems to be to rewrite the program to reuse connections and not open multiple connections per thread.
I am asking, what tools should the developer have in his tool box to be able to investigate the resources i.e. Database Connections that have been allocated by a thread.