Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 24768 invoked from network); 4 Oct 2004 16:03:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 4 Oct 2004 16:03:30 -0000 Received: (qmail 20290 invoked by uid 500); 4 Oct 2004 16:03:13 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 20204 invoked by uid 500); 4 Oct 2004 16:03:12 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 20154 invoked by uid 99); 4 Oct 2004 16:03:12 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of alt.phil@gmail.com designates 64.233.170.203 as permitted sender) Received: from [64.233.170.203] (HELO mproxy.gmail.com) (64.233.170.203) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 04 Oct 2004 09:03:11 -0700 Received: by mproxy.gmail.com with SMTP id 74so619405rnl for ; Mon, 04 Oct 2004 09:03:07 -0700 (PDT) Received: by 10.38.208.76 with SMTP id f76mr2531999rng; Mon, 04 Oct 2004 09:03:07 -0700 (PDT) Received: by 10.38.59.72 with HTTP; Mon, 4 Oct 2004 09:03:07 -0700 (PDT) Message-ID: <4647bc3104100409033e6e67e8@mail.gmail.com> Date: Mon, 4 Oct 2004 11:03:07 -0500 From: Phil Buescher Reply-To: Phil Buescher To: commons-user@jakarta.apache.org Subject: Re: commons-dbcp - failed database connection doesn't timeout In-Reply-To: <4647bc31040921093879e3e61@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <4647bc31040921093879e3e61@mail.gmail.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I just wanted to update this, although I've kind of dropped this for awhile... LoginTimeout doesn't help - I did set a LoginTimeout successfully, but that only works when creating the pool. I guess what we really need is a QueryTimeout. If the query is not returned within x seconds, throw an exception. So how would be the best way to impliment a QueryTimeout? Since we have about 50 existing web applications, I'm hoping it isn't something that has to be written in the application, but something that can go into server.xml and let Tomcat or commons-dbcp manage. Thanks, Phil On Tue, 21 Sep 2004 11:38:52 -0500, Phil Buescher wrote: > On our Tomcat 4.1.29 and Tomcat 5.0 servers, we're using commons-dbcp 1.1. > > When a database fails, (locks up, unreachable), Tomcat will attempt to > use a pooled connection and hang. We don't receive an exception > within our code indicating the database failure. > > What we're hoping for is some kind of database connection timeout. > maxWait does not seem to do the trick, and setLoginTimeout doesn't > seem to work at all. We've crawled newsgroups and websites for a few > days now trying to find a fix. > > The problem is that when a database goes down, Tomcat will continue to > accept requests, and continue to attempt to pull data back from the > database until Tomcat finally hangs, effectively getting DoSed. > > Here's a copy of the server.xml params... > > scope="Shareable" type="javax.sql.DataSource"/> > > > url > jdbc:microsoft:sqlserver://AFNBLDDEV1.afni.net:1433;databaseName=PhoneSearch > > > validationQuery > select getdate() > > > maxIdle > 30 > > > maxActive > 100 > > > driverClassName > com.microsoft.jdbc.sqlserver.SQLServerDriver > > > maxWait > 15000 > > > removeAbandoned > true > > > factory > org.apache.commons.dbcp.BasicDataSourceFactory > > > username > PHONESEARCHUSER > > > removeAbandonedTimeout > 60 > > > password > ********** > > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org