rruttimann
Joined: 14 Feb 2006 Posts: 6
|
Posted: Mon Feb 27, 2006 9:20 am Post subject: Replace built-in hibernate connection pool with c3p0 |
|
|
For testing and debugging your Foundation the built-in connection pool for hibernate is doing a good job. It's efficient and stable.
If you move to production a more scalable solution for connection pooling might be required. Hibernate supports c3p0 connection pool and a simple change in the Hibernate.cfg.xml will switch from the built-in pool to c3p0.
What you have to do is the following:
Edit hibernate.cfg.xml and add the following section
<!-- Connection pool use C3P0 Connection Pool-->
<property name="hibernate.c3p0.max_size">6</property>
<property name="hibernate.c3p0.min_size">2</property>
<property name="hibernate.c3p0.timeout">5000</property>
<property name="hibernate.c3p0.max_statements">200</property>
<property name="hibernate.c3p0.idle_test_period">3000</property>
<property name="hibernate.c3p0.acquire_increment">2</property>
<property name="hibernate.c3p0.validate">false</property>
<!--
#################################
### Plugin ConnectionProvider ###
#################################
## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in ConnectionProvider using hueristics)
-->
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<!-- Use the Hibernate built-in pool for tests.
<property name="connection.pool_size">10</property>
-->
If you build Foundation from source rebuild collage-common-impl library and re-deploy it.
If you use the binary distribution un-jar collage-commons-1.1-m2.jar update the hibernate config file and re-jar the library. |
|