-->
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.  [ 1 post ] 
Author Message
 Post subject: Using c3p0 with Springs + hibernate application hangs
PostPosted: Mon Oct 10, 2011 6:49 am 
Newbie

Joined: Mon Oct 10, 2011 6:37 am
Posts: 1
Hi

We are accessing Hibernate C3P0 connection pool using the following configuration.
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass"><value>${jdbc.driverClassName}</value></property>
<property name="jdbcUrl"><value>${jdbc.url}</value></property>
<property name="user"><value>${jdbc.username}</value></property>
<property name="password"><value>${jdbc.password}</value></property>
<property name="minPoolSize" value="5" />
<property name="maxPoolSize" value="100" />
<property name="maxIdleTime" value="900" />
<property name="maxStatements" value="0" />
<property name="initialPoolSize"><value>5</value></property>
<property name="idleConnectionTestPeriod"><value>500</value></property>
<property name="acquireRetryAttempts"><value>10</value></property>
<property name="maxIdleTimeExcessConnections"> <value>1600</value></property>
<property name="maxConnectionAge"><value>1600</value></property>
<property name="numHelperThreads"><value>6</value></property>
<property name="unreturnedConnectionTimeout"><value>500</value></property>
<!-- <property name="debugUnreturnedConnectionStackTraces"><value>true</value></property>
<property name="acquireIncrement"><value>12</value></property>
<property name="preferredTestQuery"><value>select 1</value></property>
<property name="testConnectionOnCheckin"><value>false</value></property>
<property name="breakAfterAcquireFailure"><value>false</value></property>
<property name="testConnectionOnCheckout"><value>false</value></property>
-->
<property name="automaticTestTable"><value>dual</value></property>
</bean>

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.generate_statistics">true</prop>
<prop key="hibernate.transaction.auto_close_session">true</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
<prop key="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</prop>
<prop key="hibernate.c3p0.timeout">1800</prop>
</props>
</property>
</bean>

and we are using "org.springframework.orm.hibernate3.LocalSessionFactoryBean" session factory.
the problem is the pooled connection was not released untill unreturnedConnectionTimeout was reached.
because of this when max connection was reached our application hangs.
Is there any problem with my configuration
please any one help on this.


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

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.