db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew P. Reath" <matt.re...@cciinc.us>
Subject RE: Problems with Mysql timeout
Date Tue, 08 Feb 2005 15:36:37 GMT
I'll get the testOnBorrow set and try that. I'm new to Torque and am not
quite sure on how to setup the validationQuery. What is the process for
doing that?

Matt 

-----Original Message-----
From: Bill Leng [mailto:wleng@metatomix.com] 
Sent: Tuesday, February 08, 2005 9:28 AM
To: Apache Torque Users List
Subject: Re: Problems with Mysql timeout

You can configure torque to use the
org.apache.torque.dsfactory.SharedPoolDataSourceFactory. Set
torque.dsfactory.torque.pool.testOnBorrow true. Provide a
torque.dsfactory.torque.pool.validationQuery. This setting up will guarantee
every connection returned from the pool is a good one.

Andras Balogh wrote:

> Hello,
>
> This is a MySQL related prolbem You must specify autoreconnect=true 
> (or something like) that at connection properties. You will find this 
> info on the mysql site, jdbc connection properties.
>
> Best regards,
> Andras.
>
> Matthew P. Reath wrote:
>
>> I'm developing a web-based application using Tomcat/Torque/MySQL. The 
>> problem I run into is that after 8 hours of inactivity the persistent 
>> connection Torque uses becomes invalid and I get an exception. The 
>> next time I try it works. After another 8 hours of idle time the 
>> process repeats.
>>
>> I searched the internet for answers but most of them involved good 
>> programming practice to handle this situation in one's own JDBC code, 
>> I however am using Torque.
>>
>> Is there a way to configure Torque to handle this timeout period? I'd 
>> rather not depend on the connection always being there in case it was 
>> dropped because of network problems or what not. Ideally I would like 
>> Torque to reconnect anytime it's connection becomes invalid or do 
>> some sort of heartbeat.
>> Thanks,
>> Matt
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: torque-user-help@db.apache.org
>>
>>  
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


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


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


Mime
View raw message