Asking c3p0 how many connections are in use

浪子不回头ぞ 提交于 2019-12-08 09:34:56

问题


Is there a way to programatically ask c3p0 how many of it's connections are being used, or perhaps logs when the pool is exhausted.


回答1:


As indicated in the URL referenced by Austin's comment above, you can use JMX to inspect and modify running c3p0 PooledDataSources.

You can also do so programmatically. c3p0's PooledDataSources have an elaborate API for inspecting their state:

http://www.mchange.com/projects/c3p0/apidocs/com/mchange/v2/c3p0/PooledDataSource.html

If you are using ComboPooledDataSource, you have access to an even richer API.

http://www.mchange.com/projects/c3p0/apidocs/com/mchange/v2/c3p0/ComboPooledDataSource.html

I hope this helps!



来源:https://stackoverflow.com/questions/12725508/asking-c3p0-how-many-connections-are-in-use

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