Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 65783 invoked from network); 22 Sep 2007 21:04:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Sep 2007 21:04:05 -0000 Received: (qmail 42361 invoked by uid 500); 22 Sep 2007 21:03:44 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 42336 invoked by uid 500); 22 Sep 2007 21:03:44 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 42325 invoked by uid 99); 22 Sep 2007 21:03:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Sep 2007 14:03:44 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 24.24.2.57 is neither permitted nor denied by domain of dns4@cornell.edu) Received: from [24.24.2.57] (HELO ms-smtp-03.nyroc.rr.com) (24.24.2.57) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Sep 2007 21:05:50 +0000 Received: from [192.168.5.102] (cpe-24-59-111-127.twcny.res.rr.com [24.59.111.127]) by ms-smtp-03.nyroc.rr.com (8.13.6/8.13.6) with ESMTP id l8ML3KGa001206 for ; Sat, 22 Sep 2007 17:03:20 -0400 (EDT) Message-ID: <46F58318.6060404@cornell.edu> Date: Sat, 22 Sep 2007 17:03:20 -0400 From: David Smith User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: tomcat can not connect to MySql References: <12834957.post@talk.nabble.com> In-Reply-To: <12834957.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Virus-Checked: Checked by ClamAV on apache.org Can you provide some specifics of your environment? Tomcat version OS Mysql version (both driver and server) Both tomcat and mysql on the same machine? If not, any firewalls that might be timing out a connection? How long does it run before it doesn't work? Can you post the full stack trace of your exception including root cause? In your design, are you holding on to connections or closing them as soon as you are done talking to the db? Mysql server does timeout connections after 8 hours by default. If you are using tomcat's database pooling, this can be fixed with the simple addition of a validation query in the config. In any case, it's best practice for the code querying the db to close connections as soon as reasonably possible and not keep them open. --David fdehghani wrote: > I ues Appache tomcat as my App Server in my project > but when running its service, after sometime when run my project,tomcat say > that can not connect to database(SystemException) > then i should restart its service to work correctly. > i'm not sure thet its tomcat's problem or MySql > please help me. > --------------------------------------------------------------------- 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