Hibernate not releasing data base connections
        Posted  
        
            by cedar715
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by cedar715
        
        
        
        Published on 2010-03-19T12:35:27Z
        Indexed on 
            2010/03/19
            15:51 UTC
        
        
        Read the original article
        Hit count: 550
        
Following is the configuration details:
<property name="hibernateProperties">
   <props>
    <prop key="hibernate.dialect">
     org.hibernate.dialect.Oracle9iDialect
    </prop>
    <prop key="hibernate.show_sql">false</prop>
    <prop key="hibernate.cache.provider_class">
     org.hibernate.cache.OSCacheProvider
    </prop>
    <prop key="hibernate.cache.use_second_level_cache">
     true
    </prop>
    <!-- <prop key="hibernate.hbm2ddl.auto">update</prop>-->
    <!-- HIBERNATE CONNECTION POOLING!!-->
    <prop key="c3p0.acquire_increment">5</prop>
    <prop key="c3p0.idle_test_period">100</prop>
    <!-- seconds -->    
    <prop key="c3p0.max_statements">5</prop>
    <prop key="c3p0.min_size">15</prop>
                            <prop key="c3p0.max_size">100</prop> 
    <prop key="c3p0.timeout">100</prop>
    <!-- seconds -->
   </props>
  </property>
Our application is developed through Spring & Hibernate.
Once we bring the application up and hit it, its opening 140 connections and not releasing it.
Our DAO looks like this:
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
...
public class ActionDAO extends HibernateDaoSupport implements IActionDAO {
 public Action findById(ActionPK actionPK) {
  return (Action) getHibernateTemplate().get(Action.class, actionPK);
 }
 public void add(Action action) {
  getHibernateTemplate().save(action);
 }
}
        © Stack Overflow or respective owner