« Return to Thread: apache dbcp + mysql reconnect problem

Re: apache dbcp + mysql reconnect problem

by Jason Novotny-3 :: Rate this Message:

Reply to Author | View in Thread


    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@...
> For additional commands, e-mail: user-help@...
>
>  


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

 « Return to Thread: apache dbcp + mysql reconnect problem