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: getHibernateTemplate hangs for 2-5 minutes..
PostPosted: Fri Jun 16, 2006 11:55 am 
Newbie

Joined: Fri Apr 28, 2006 10:14 am
Posts: 11
Location: Paris, France
Hibernate version: 3.1.2

Name and version of the database you are using: Oracle

When I unplug my ethernet cable to simulate a network problem or the database going down, my application hangs for 2-5 minutes on the call to Spring getHibernateTemplate(). I can see in the debugger than the thread is in the wait state in SQL code to obtain the connection. Is there anyway to reduce this timeout? My HTTP request is timing out before my app can respond with an error message.

The second issue is I'm trying to use c3p0 just to see if I can have it validate connections but that's not having any effect. I try a c3p0.properties with:

c3p0.min_size=5
c3p0.max_size=20
c3p0.timeout=500
c3p0.max_statements=50
c3p0.idleTestPeriod=1
c3p0.testConnectionOnCheckout=true

as well as passing them via spring:

<bean
id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.use_outer_join">${hibernate.use_outer_join}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop>
<prop key="c3p0.min_size">5</prop>
<prop key="c3p0.max_size">20</prop>
<prop key="c3p0.timeout">500</prop>
<prop key="c3p0.max_statements">50</prop>
<prop key="c3p0.idleTestPeriod">1</prop>
<prop key="c3p0.testConnectionOnCheckout">true</prop>
</props>
</property>
<property
name="mappingDirectoryLocations"
value="classpath:/canal/det/modele" />
</bean>

but this seems to have no effect.

what should I do next?

-Michael


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.