Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 30325 invoked from network); 14 Apr 2005 09:25:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Apr 2005 09:25:01 -0000 Received: (qmail 51033 invoked by uid 500); 14 Apr 2005 09:24:47 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 50970 invoked by uid 500); 14 Apr 2005 09:24:46 -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 50955 invoked by uid 99); 14 Apr 2005 09:24:46 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of sanjeetjoshi@gmail.com designates 64.233.162.193 as permitted sender) Received: from zproxy.gmail.com (HELO zproxy.gmail.com) (64.233.162.193) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 14 Apr 2005 02:24:45 -0700 Received: by zproxy.gmail.com with SMTP id 18so1252274nzp for ; Thu, 14 Apr 2005 02:24:39 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=TsXu8CA5fx7NMLJxxpXQzWQoF+yrxF/hIdH3MwFuqlOwtf36Aq0uVD5DETGZ/5bwnxG3QTR6NIU/X9sI6IgPNFw+9bh+gaKUVlBtrZp2zaH9d1qchsPf27aPgwckCgPfoLw+GBMtA9zfupeIAvt08ySCPUX/DhXiNaLlcxRfwgY= Received: by 10.36.101.17 with SMTP id y17mr99043nzb; Thu, 14 Apr 2005 02:24:39 -0700 (PDT) Received: by 10.36.33.20 with HTTP; Thu, 14 Apr 2005 02:24:39 -0700 (PDT) Message-ID: Date: Thu, 14 Apr 2005 14:54:39 +0530 From: Sanjeet Joshi Reply-To: Sanjeet Joshi To: Jakarta Commons Users List Subject: Re: MySQL connection problem using DBCP In-Reply-To: <425CB689.3060109@pandora.be> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <425CB689.3060109@pandora.be> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Dirk, Thanks for your help and the corrections suggested. After getting you mail I changed the DB url to inclue autoReconnect=3Dtrue in following files. (name of my webapp is PV) 1. tomcat5/conf/Catalina/localhost/PV.xml ---> in this file I have configured JDBCRealm for Container managed security and 2. struts-config.xml --> all my datasources configured here After the change I restarted tomcat. But after 8 hours I got the same probl= em=20 >> java.sql.SQLException: Communication link failure: java.io.EOFException, underlying cause: null Where exactly should I set autoReconnect? and does it really work? Should I configure this in server.xml file? Your help will be really appreciated.... Regards, Sanjeet On 4/13/05, Dirk Verbeeck wrote: > The first config doesn't work, that should be something like: > value=3D"autoReconnect=3Dtrue" /> >=20 > but most people use your second solution (the url version) >=20 > -- Dirk >=20 > Sanjeet Joshi wrote: >=20 > > Hi, > > > > I am facing a problem with Connections to the database. > > > > Here is the development environment in short: > > > > Struts, Jsp, Servlets and MySQL 4.1 > > I am using DBCP connection pooling. The datasource configuration is > > in struts-config.xml file. I am using container managed security for > > authentication. > > > > I get EOFException when I try to login (or access the db for any other > > purpose). This happens only after a long period of db inactivity. > > Otherwise everything works fine. > > > > When I searched for a solution, I found out that MySQL closes all > > inactive connections after 8 hours. I also found out that setting a > > MySQL attribute autoReconnect=3Dtrue solves this. I tried setting it > > along with my datasource config in struts-config.xml as follows: > > > > > > > > > > > > > > > > > > > > > > > > Is this the correct way of setting autoReconnect to true? Some > > solutions suggested setting it along with the url i.e. like > > > > > value=3D"jdbc:mysql://localhost:3306/xyz?autoReconnect=3Dtrue" /> > > > > Which of these is correct? > > > > To test this solution I tried to reduce the wait_timeout and > > interactive_timeout (both MySQL variables) from 8 hours to one minute. > > The connections were closed after a minutes inactivity. But my webapp > > worked absolutely fine (without autoReconnect=3D"true") So I could not > > get EOFException on my development machine. > > > > Is there anyone who has faced this problem and solved it? Any Pointers > > to any reading material about this? > > > > Any help is appreciated. > > > > Thanks in advance. > > Sanjeet > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > > > > > > > >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org >=20 > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org