Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 74188 invoked from network); 1 Oct 2009 21:35:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Oct 2009 21:35:28 -0000 Received: (qmail 59554 invoked by uid 500); 1 Oct 2009 21:35:24 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 59476 invoked by uid 500); 1 Oct 2009 21:35:24 -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 59465 invoked by uid 99); 1 Oct 2009 21:35:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Oct 2009 21:35:24 +0000 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: local policy) Received: from [76.96.62.64] (HELO QMTA07.westchester.pa.mail.comcast.net) (76.96.62.64) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Oct 2009 21:35:12 +0000 Received: from OMTA17.westchester.pa.mail.comcast.net ([76.96.62.89]) by QMTA07.westchester.pa.mail.comcast.net with comcast id nWEk1c0021vXlb857ZasjT; Thu, 01 Oct 2009 21:34:52 +0000 Received: from [192.168.1.200] ([69.143.128.194]) by OMTA17.westchester.pa.mail.comcast.net with comcast id nZh91c00J4BnRt93dZh9NJ; Thu, 01 Oct 2009 21:41:10 +0000 Message-ID: <4AC52079.2080606@christopherschultz.net> Date: Thu, 01 Oct 2009 17:34:49 -0400 From: Christopher Schultz User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.4pre) Gecko/20090915 Thunderbird/3.0b4 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Tomcat 6.X and MySQL connection pooling issue References: <25677820.post@talk.nabble.com> <25693459.post@talk.nabble.com> <4AC4D38A.7070000@christopherschultz.net> <25702523.post@talk.nabble.com> In-Reply-To: <25702523.post@talk.nabble.com> X-Enigmail-Version: 0.97a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Martin, On 10/1/2009 12:53 PM, MartinOShea wrote: > private static DataSource dataSource = null; I wouldn't recommend caching the DataSource object. This limits your ability to reconfigure the DataSource on the fly if you want to. Local JNDI lookups are super fast, so caching doesn't really save you that much time. > This should be read in tandem with the code I posted yesterday illustrating > a typical database operation. > > How do I switch query logging on though? On the server: http://dev.mysql.com/doc/refman/5.0/en/query-log.html On the client: http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html (Look for the profileSQL setting). Note that, if you are using DBCP's reconnection capabilities, it's not necessary to set autoReconnect=true in the connection string (you'll just end up creating 2 new connections when your connection is dropped, though the first one will end up being destroyed pretty quickly). - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkrFIHkACgkQ9CaO5/Lv0PDUcwCfW1Wz6ieZ0pEnm/p+dm9vsiVo IFIAoIlQSxys4cHzVi+YAro3BDrV0dju =Ojns -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org