-->
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.  [ 2 posts ] 
Author Message
 Post subject: hibernate.c3p0.max_statements not working for me
PostPosted: Tue May 08, 2007 4:41 am 
Beginner
Beginner

Joined: Mon Apr 23, 2007 8:30 am
Posts: 27
Location: India
It looks like Hibernate is not able to set the hibernate.c3p0.max_statements property in my application. Here is my hibernateProperties from spring config

Code:
<property name="hibernateProperties">
         <props>
            <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
            <prop key="hibernate.show_sql">true</prop>
            <prop key="hibernate.c3p0.min_size">10</prop>
            <prop key="hibernate.c3p0.max_size">50 </prop>
            <prop key="hibernate.c3p0.idle_test_period">300</prop>
            <prop key="hibernate.c3p0.timeout">0</prop>
            <prop key="hibernate.c3p0.max_statements">15</prop>
            <prop key="hibernate.c3p0.acquire_increment">3</prop>
         </props>
</property>



The spring datasource config is :-
Code:
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
      <property name="driverClass" value="${jdbc.driverClassName}"/>
      <property name="jdbcUrl" value="${jdbc.url}"/>
      <property name="user" value="${jdbc.username}"/>
      <property name="password" value="${jdbc.password}"/>
      <property name="acquireRetryAttempts" value="3"/>
      <property name="maxStatementsPerConnection" value="5"/>
      <!-- <property name="maxStatements" value="15"/> -->   
</bean>


With maxStatements commented in datasource, I expect the hibernateProperties hibernate.c3p0.max_statements to be active. However the following log shows the Hibernate default value for max statements which is 0

2007-05-08 13:53:47,212 INFO [com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource] - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 3, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 17g3ycg7mtmnwdimi191y|1284fd4, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> oracle.jdbc.driver.OracleDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 17g3ycg7mtmnwdimi191y|1284fd4, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:oracle:thin:@localhost:1521:xxxx, lastAcquisitionFailureDefaultUser -> null, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 5, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]


When maxStatements in datasource configuration is uncommented, the max statements are configured correctly to 15 as defined in the datasource.

From what i understand, some of the c3p0 properties must be explicitly mentioned in the hibernate config, to prevent from using hibernate defaults over the actual c3p0 properties. In this case, why is Hibernate not able to set hibernate.c3p0.max_statements? I am using Hibernate 3. Am I missing something?

Thanks,
Nik


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 08, 2007 4:58 am 
Beginner
Beginner

Joined: Mon Apr 23, 2007 8:30 am
Posts: 27
Location: India
Sorry to post this here, moving it to Hibernate Users forum.

Thanks,
Nik


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.