Hibernate: Config properties, c3p0 and disable the cache level
July 30th, 2009 by jeremychone
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost/dbname?useUnicode=true&characterEncoding=UTF8
hibernate.connection.username=username
hibernate.connection.password=pwd
#only if you use the current session
hibernate.current_session_context_class=thread
hibernate.connection.release_mode=on_close
#disable the second level cache
hibernate.cache.use_second_level_cache=false
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
#do not forget the provider_class to set C3P0. No more auto detect in Hibernate 3.0.0+
hibernate.connection.provider_class=org.hibernate.connection.C3P0ConnectionProvider
hibernate.c3p0.min_size=5
hibernate.c3p0.max_size=20
hibernate.c3p0.timeout=1800
Posted:
Thursday, July 30th, 2009
Tags: Hibernate.
Actions: RSS 2.0 feed.
You can leave a response, or trackback from your own site.
July 30th, 2009 at 8:23 am
Don’t forget to add the c3p0 jars to your classpath, or it won’t be picked up.
July 31st, 2009 at 3:58 pm
@Alex, yes good point. Silence can be miss-leading.