commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Novotny <jason.novo...@gmail.com>
Subject Re: apache dbcp + mysql reconnect problem
Date Mon, 22 Jun 2009 20:36:41 GMT

    Cool, thanks a lot Mark-- I'll give that a try. Yeah its one of 
those things where my app connects once a day right now in "testing" ;-) 
but will probably do more when its in production... so maybe I need two 
spring configs one that uses dbcp and the other mysql directly.

    Cheers, Jason

Mark Thomas wrote:
> 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
>
>   


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


Mime
View raw message