How does the database get disconnected? Unfortunately, I'm not sure how to
reconnect when it fails if it doesn't already happen automatically.

On Fri, May 1, 2009 at 10:09 AM, Albert.Chao <albert.c...@groupdca.com>wrote:

>  Hi all,
>
>
>
> Could someone help me to solve “disconnected database when user login”?
>
>
>
> I have these values in applicationConext-resource.xml.
>
> I started webserver / database then shutdown database to do this test case.
>
> When I login, I still get
>
>
>
> org.springframework.transaction.CannotCreateTransactionException: Could not 
> open Hibernate Session for transaction; nested exception is 
> org.hibernate.exception.JDBCConnectionException: Cannot open connection
>
>          at 
> org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:550)
>
>
>
> I have put   <global-exception-mappings> <exception-mapping
> exception="java.lang.Exception" result="home"/>
>
> It still gives me stack error
>
>
>
>
>
> How to solve this issue?
>
>
>
> applicationConext-resource.xml
>
>   <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close">
>
>         <property name="driverClassName" value="${jdbc.driverClassName}"/>
>
>         <property name="url" value="${jdbc.url}"/>
>
>         <property name="username" value="${jdbc.username}"/>
>
>         <property name="password" value="${jdbc.password}"/>
>
>         <property name="maxActive" value="100"/>
>
>         <property name="maxWait" value="1000"/>
>
>         <property name="poolPreparedStatements" value="true"/>
>
>         <property name="defaultAutoCommit" value="true"/>
>
>         <property name="validationQuery" value="select 1 from dual"/>
>
>         <property name="testOnBorrow" value="true"/>
>
>     </bean>
>

Reply via email to