-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: How do i get c3p0.properties file works
PostPosted: Wed Aug 16, 2006 4:37 am 
Newbie

Joined: Tue Oct 05, 2004 12:14 am
Posts: 8
I am using Spring with hibernate, i set the spring config xml file to use c3p0 connection pool like below:

Code:
   <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
      <!--<property name="lobHandler">
         <ref local="lobHandler" />
      </property>-->
      <property name="hibernateProperties">
         <props>
            <prop key="hibernate.connection.driver_class">${jdbc.drivers}</prop>
            <prop key="hibernate.connection.url">${jdbc.url}</prop>
            <prop key="hibernate.connection.username">${jdbc.username}</prop>
            <prop key="hibernate.connection.password">${jdbc.password}</prop>
            <prop key="hibernate.c3p0.min_size">5</prop>
            <prop key="hibernate.c3p0.max_size">100</prop>
            <prop key="hibernate.c3p0.timeout">1800</prop>
            <prop key="hibernate.c3p0.max_statements">50</prop>
            <prop key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop>
            <prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
            <prop key="hibernate.show_sql">true</prop>
            <prop key="hibernate.format_sql">true</prop>
         </props>
      </property>


But i still want to set some additional c3p0 attributes, so i wrote a c3p0.peoperties file and put it in the classpath.

Code:
c3p0.initialPoolSize=10


after i started the server and checked log, the initialPoolSize is still 5, so it didn't work.
Did i miss something to use the property file?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 19, 2006 4:51 am 
Newbie

Joined: Tue Oct 05, 2004 12:14 am
Posts: 8
please help me :D


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 28, 2006 8:37 am 
C3P0 Developer
C3P0 Developer

Joined: Tue Jan 06, 2004 8:58 pm
Posts: 145
Hi. Hibernate sets c3p0's initialPoolSize to minPoolSize. There's not much you can do about it, but it doesn't hurt much either. Verify that other settings from your c3p0.properties file flow through to your config.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 31, 2006 2:31 am 
Newbie

Joined: Tue Oct 05, 2004 12:14 am
Posts: 8
so u mean if i use hibernate built-in c3po support, i can not use c3po.properties file?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


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

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.