I'm using Apache Commons DBCP. There is a task to track the inner behavior of the DBCP - number of active and idle connections.
I found out that DBCP lacks any such logging at all. Yes, tt is possible to write the code that outputs the status of the BasicDataSource when connection is borrowed from the pool. However there is no way to track the status of the BasicDataSource when connection is returned or closed, because connection object knows nothing about the pool.
Any ideas?