Monitoring c3p0 state HOWTO

Last modified 12 Nov 2021 16:57 +01:00
OBSOLETE
This functionality is obsolete. It is no longer supported or maintained.

If you need to monitor the state of c3p0 connection pool, you can do it e.g. via JMX. Here’s how.

  1. If your server runs locally, you don’t need to do anything special. Local JMX connections should work without problems. (There might be some issues when trying to connect to a tomcat running as a Windows service, though. In such cases maybe the remote approach would work.)

  2. If your server runs remotely, you can allow JMX connections exactly in the same way as if configuring a cluster (by setting com.sun.management.jmxremote.port, com.sun.management.jmxremote.ssl, com.sun.management.jmxremote.password.file and com.sun.management.jmxremote.access.file).

After setting up JMX and starting the server you can run a JMX tool such as JConsole to connect to it and view c3p0 statistics:

  1. Run jconsole (a part of JDK). Select either local process to manage, or enter connection information needed to reach a remote one:

image2016 9 23 0 18 38
  1. After confirming insecure connection (that should not be a problem in a local environment), click on MBeans tab and select appropriate PooledDataSource and its attributes. It should look like this:

image2016 9 23 0 20 58
Was this page helpful?
YES NO
Thanks for your feedback