Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 18723 invoked from network); 24 Jun 2003 16:20:29 -0000 Received: from unknown (HELO beethoven.lokitech.com) (216.7.13.68) by daedalus.apache.org with SMTP; 24 Jun 2003 16:20:29 -0000 Received: from host110.lokitech.com ([216.7.13.110]) by mail.lokitech.com (JAMES SMTP Server 2.0a3-cvs) with SMTP ID 979 for ; Tue, 24 Jun 2003 12:20:32 -0400 Message-ID: <3EF87A5E.1030006@lokitech.com> Date: Tue, 24 Jun 2003 12:20:46 -0400 From: Serge Knystautas User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030529 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: [DBCP] Testing of connections References: <74695470-A65F-11D7-8F1F-003065672418@antwerpes.de> In-Reply-To: <74695470-A65F-11D7-8F1F-003065672418@antwerpes.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N There actually has just been some recent discussion on how to handle this better. For now, you can add a SQL statement to verify the connection after each use. -- Serge Knystautas President Lokitech >> software . strategy . design >> http://www.lokitech.com p. 301.656.5501 e. sergek@lokitech.com Johannes Lietz wrote: > I've got the following problem: > > I'm using DBCP from inside Tomcat to connect to a database. Between > Tomcat and database server is a firewall. > > And this firewall is causing problems: when a database connection is > idle for some time, the firewall will block this connection, and not > drop the connection. > > Therefore DBCP thinks the connection is still open and alive and tries > to use it. And as the connection is blocked, DBCP will wait eternally > until something happens. > > > My question: Is there any way to configure DBCP to test connections > regularly and refresh them if necessary? Or to set a timeout when a > connection is declared dead and dropped?