tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Bowen <kbo...@als.com>
Subject Re: [Same Behavior]Connections timing out even with validation query??
Date Wed, 16 Jul 2008 12:42:37 GMT
David:

On Jul 16, 2008, at 8:20 AM, David Smith wrote:

> I don't think "1000*60" is a valid expression for  
> timeBetweenEvictionRunsMillis -- at least I've never tried putting  
> math expressions where an integer constant should be.  It should be  
> set to 60000.

I just copied part of the expression (1000 * 60 * 30)  for  
minEvictableIdleTimeMillis on http://commons.apache.org/dbcp/configuration.html 
, but you're probably right -- that may just be for readability in the  
doc.

> Also are you keeping your connections in code or closing them when  
> finished?  They should be closed as soon as reasonable so they can  
> return to the connection pool.

All connections are /supposed/ to be closed when the interaction if  
finished, but there still could be one slipping through.

>
> --David
>
> Ken Bowen wrote:
>> Unfortunately, overnight produced the same Exception, even with the  
>> settings described.
>> Any other thoughts anyone?
>>
>> --Ken
>>
>> On Jul 15, 2008, at 12:34 PM, Ken Bowen wrote:
>>
>>> Definitely a plan.  I put the following in my context.xml:
>>>
>>>        validationQuery="select 1"
>>>         testWhileIdle="true"
>>>         timeBetweenEvictionRunsMillis="1000*60"
>>>         removeAbandoned="true"
>>>
>>> I set connect_timeout=5 in /etc/my.cnf,  and restarted both mysql  
>>> and tomcat.
>>> After 30min, everything's fine, but that's not much of test.  I'll  
>>> see what it looks like tomorrow morning.
>>>
>>> Thanks,
>>> Ken
>>>
>>>
>>> On Jul 15, 2008, at 10:23 AM, Hassan Schroeder wrote:
>>>
>>>> On Tue, Jul 15, 2008 at 4:04 AM, Ken Bowen <kbowen@als.com> wrote:
>>>>
>>>>> The problem: With MySQL connect_timeout = 5, I'm getting timeout  
>>>>> exceptions
>>>>> (below)  even though I have a
>>>>> validation query set; Here's my app's META-INF/context-xml:
>>>>>
>>>>> <Context path="" debug="5" reloadable="true" crossContext="true">
>>>>> <Resource name="jdbc/sb_data" auth="Container"  
>>>>> type="javax.sql.DataSource"
>>>>>         maxActive="100" maxIdle="30" maxWait="10000"
>>>>>         username="xxxxxx" password="xxxxxx"
>>>>>         driverClassName="com.mysql.jdbc.Driver"
>>>>>         url="jdbc:mysql://localhost:3306/sb_data"
>>>>>         validationQuery="select 1"/>
>>>>
>>>> <http://commons.apache.org/dbcp/configuration.html>
>>>>
>>>> You might try setting testWhileIdle to true (with a reasonable  
>>>> value
>>>> for  timeBetweenEvictionRunsMillis) and removeAbandoned to true.
>>>>
>>>> Just to see if that changes/eliminates the symptom...
>>>>
>>>> FWIW,
>>>> -- 
>>>> Hassan Schroeder ------------------------  
>>>> hassan.schroeder@gmail.com
>>>>
>>>> ---------------------------------------------------------------------
>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
>
> -- 
> David Smith
> Programmer/Analyst
> College of Agriculture and Life Sciences
> Cornell University
> B32 Morrison Hall
> Ithaca, NY 14853
> Phone: (607) 255-4521
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message