Question

  • I've got a jetty application using c3p0 connection pooling.
  • I have a c3p0.properties file under WEB-INF/classes of my webapp

As seen in the C3P0 configuration manual there are two different ways to name a C3P0 connection pool in JMX: - c3p0.dataSourceName=oneWayOfNamingThePool - com.mchange.v2.c3p0.management.RegistryName=anotherWayOfNamingThePool

So my question is: what is the difference between these two properties?

Was it helpful?

Solution

  • dataSourceName represents the name of a single JDBC DataSource. one application might potentially have many of these. these are where the actual Connection pools live.

  • com.mchange.v2.c3p0.management.RegistryName represents the name of a JMX nean that tracks the C3P0Registry class, a static utility class that keeps track of c3p0 DataSources currently live and permits looking them up by name or iterating through them.

the two are both JMX names, but of completely different things. one application could have many different dataSourceName values (one for each of many running DataSources), but will only have one com.mchange.v2.c3p0.management.RegistryName. (really it's one per ClassLoader rather than one per application, but we'll let that distinction slide for now.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top