Search code examples
javatomcatjakarta-eejdbcc3p0

How to find which application created each c3p0 connection pool?


In Tomcat, I have a shared c3p0 jar placed in Tomcat's lib folder with three different applications using it.

Is there a way to identify which application created which connection pool?


Solution

  • An easy thing to do is to use c3p0's named configurations to define a distinct configuration for each application, and let each application construct its own pool. The dataSourceName parameter will let you permanently discriminate between your DataSources, e.g. in a JMX MBean client.