Java code to get lost active DB Connection back to the connection pool

与世无争的帅哥 提交于 2019-12-11 23:43:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!