commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: apache dbcp + mysql reconnect problem
Date Mon, 22 Jun 2009 20:25:32 GMT
Jason Novotny wrote:
> 
> Hi,
> 
>    My application connects to the database maybe once a day.

Which begs the question is there really any need to use DBCP?

> The first
> time after I startup my app everything works fine, however the next day
> when it tries to connect to the MySql database I get an exception posted
> at the end.
> 
> I'm using spring 2.6+hibernate 3.4+apache dbcp+ MySql 5.0.44...  the
> dbcp configuration in Spring looks like:
> 
> <bean id="dataSource" destroy-method="close"
> class="org.apache.commons.dbcp.BasicDataSource">
>        <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="15"/>
>        <property name="maxIdle" value="5"/>
>        <property name="maxWait" value="120000"/>
>    </bean>
> 
> Wondering is someone has any idea how to solve this problem...

I suspect a validation query on configured to run on borrow would solve
this.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message