Take the 2-minute tour ×  I'm using spring + hibernate + tomcat
jdbc in my java application. I want to be able to handle
connection problem when , for exemple, a database crash occur.
The problem I got is that hibernate block on trying to get a
jdbc connection (when for exemple the mysql is down) and never
timeout making the http request hanging indefinitly.  Here's my
hibernate config :  <bean id="sessionFactory" class="org.springf
ramework.orm.hibernate3.LocalSessionFactoryBean">   <property
name="dataSource">     <ref bean="dataSource"/>   <property
name="hibernateProperties">          <prop
key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
<property name="mappingResources">  And my jdbc datasource
config :  <bean id="dataSource"
class="org.apache.tomcat.jdbc.pool.DataSource" destroy-
method="close">      <property name="driverClassName"
value="${jdbc.driverClassName}"/>     <property name="url"
value="${jdbc.url}"/>     <property name=