Groundwork Support Forum
Community forum for Groundwork Open Source Products
 
 FAQ   Search   Memberlist   Usergroups   Register 
 Profile   Log in to check your private messages   Log in 

Replace built-in hibernate connection pool with c3p0

 
       Groundwork Support Forum Forum Index -> Installation and Configuration
View previous topic :: View next topic  
Author Message
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.
Back to top
Display posts from previous:   
       Groundwork Support Forum Forum Index -> Installation and Configuration All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group