wouvlfe,
First, you should check out your c3p0 pool's config dump at initialization, to see what parameter values c3p0 is actually seeing. I'm not sure how you are instantiating and configuring the DataSource that matters to you, whether hibernate is doing it with its internal provider, or Spring is creating a ComboPooledDataSource for you. The difference is important. hibernate.c3p0.max_size and hibernate.c3p0.min_size only have meaning if hibernate's C3P0ConnectionProvider is creating and configuring the DataSource.
hibernate.c3p0.min_size is equivalent to c3p0.minPoolSize.
hibernate.c3p0.max_size is equivalent to c3p0.maxPoolSize.
Please see the Appendix on hibernate integration in c3p0's docs.
For any single c3p0 DataSource, there will be precisely one pool per user authentification. In the most common case, when clients use only the default getConnection() method, a DataSource maps to a single pool, which expands and contracts with load, depending upon your configuration.
If multiple user-authentifications make use of the same DataSource [that is, if client applications sometimes call ds.getConnection( user, pwd )], then for each user-authentification to the database, there will be one distinct pool. getNumUserPools() returns the number of such pools, which will be the same as the number of authentification credenials (including the default creditials) the DataSource has seen.
Re your final question/example if a SINGLE database user is interacting with a single c3p0 DataSource, only one internal pool would be created, and getNumUserPools() would return 1.
Hope this helps!
Steve
|