1

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.

Clinton Bosch
  • 2,497
  • 4
  • 32
  • 46
  • 2
    http://stackoverflow.com/questions/4104125/how-to-monitor-c3p0-connections That could be helpful – Austin Oct 04 '12 at 10:46

1 Answers1

2

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!

Steve Waldman
  • 13,689
  • 1
  • 35
  • 45