I set the max_connection_age property in hibertnate.cfg.xml but it is not read on system startup.
(i.e. i set it to 2 mins but I still see that it is zero through the log when my app launches)
Logged In: YES
hi. so, unfortunately, you can't set maxConnectionAge via hibernate's configuration (yet). please checkout the html docs that come with c3p0's distribution, the appendix on hibernate/c3p0 integration. Several c3p0 config params MUST be set in hibernate's config; the rest must be set in a c3p0.properties (or a c3p0-config.xml) file. maxConnectionAge is one of the latter.
to set maxConnectionAge, place a file called c3p0.properties at the root of our applications effective classpath, and include...
in that file.
This confusing bifurcation of c3p0 configuration with hibernate will, I think, be resolved in the next release of hibernate. (with many thanks to the hibernate people, it looks like we may finally have worked this out.) You certainly aren't the only one to find this split configuration weird and inconvenient.
Log in to post a comment.