问题
I am facing connection leakage problem with DBCP2.
I went though all the code base and have closed/released the connections wherever required.
I have also run Sonar, but no connection leakages were reported.
Finally I have decide to write a java based executor service which will close or return the DB connections back to the pool periodically. The service should run once in 2 days.
Can someone help with the code to close the connections which are not returned to pool?
来源:https://stackoverflow.com/questions/54126965/java-code-to-get-lost-active-db-connection-back-to-the-connection-pool