#42 unable to set max_connection_age

closed
nobody
None
5
2007-01-02
2006-12-19
vkum
No

Hi,

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)

Discussion

  • Steve Waldman

    Steve Waldman - 2007-01-02
    • status: open --> closed
     
  • Steve Waldman

    Steve Waldman - 2007-01-02

    Logged In: YES
    user_id=175530
    Originator: NO

    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...

    c3p0.maxConnectionAge=120

    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.

    Good luck!

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks