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
|
|