Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 97522 invoked from network); 7 Jun 2006 15:19:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Jun 2006 15:19:01 -0000 Received: (qmail 71708 invoked by uid 500); 7 Jun 2006 15:18:58 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 71481 invoked by uid 500); 7 Jun 2006 15:18:57 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 71458 invoked by uid 99); 7 Jun 2006 15:18:57 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jun 2006 08:18:57 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.98.31] (HELO brmea-mail-1.sun.com) (192.18.98.31) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jun 2006 08:18:55 -0700 Received: from fe-amer-05.sun.com ([192.18.108.179]) by brmea-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id k57FIYvL017228 for ; Wed, 7 Jun 2006 09:18:34 -0600 (MDT) Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) id <0J0H00201WUK0C00@mail-amer.sun.com> (original mail from Farrukh.Najmi@Sun.COM) for derby-user@db.apache.org; Wed, 07 Jun 2006 09:18:34 -0600 (MDT) Received: from [129.150.65.191] by mail-amer.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPSA id <0J0H00JY2X6XAJ20@mail-amer.sun.com> for derby-user@db.apache.org; Wed, 07 Jun 2006 09:18:34 -0600 (MDT) Date: Wed, 07 Jun 2006 11:17:36 -0400 From: Farrukh Najmi Subject: Newbie questions on PreparedStatement in Derby Sender: Farrukh.Najmi@Sun.COM To: Derby Discussion Message-id: <4486EE10.3020709@sun.com> MIME-version: 1.0 Content-type: multipart/mixed; boundary="Boundary_(ID_mMAWLKOgSj8II9F15iP3vQ)" User-Agent: Thunderbird 1.5.0.2 (X11/20060420) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. --Boundary_(ID_mMAWLKOgSj8II9F15iP3vQ) Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT My application uses Derby 10.1 in a derby client that is a servlet running within a Servlet Container (typically Sun Java Application Srever 8.2 a.k.a AS or Tomcat 5.0.x). We use PreparedStatement quite a bit. I would like to know what we can do to maximize reuse of PreparedStatement optimization plan within Derby. Whose job is it to do PreparedStatement pooling? Is is Derby's or the container (AS / Tomcat)? What can we do do maximize leverage of PreparedStatement caching in my configurations? BTW We do not typically close our PreparedStatement basedon the possibly faulty assumption that this would remove the PreparedStatement form the PreparedStatement cache. We instead rely on Connection.close() to take care of doing whatever closing is needed to be done. Is this a bad practice? Above practice has led us into trouble with the following known Derby issue: http://issues.apache.org/jira/browse/DERBY-210 It seems the workaround is to close all PreparedStatements explicitly. If we do that will it remove PreparedStatement that is being closed from the PreparedStatement cache? Thanks for any guidance on this. -- Regards, Farrukh --Boundary_(ID_mMAWLKOgSj8II9F15iP3vQ) Content-type: text/x-vcard; name=farrukh.najmi.vcf; charset=utf-8 Content-transfer-encoding: 7BIT Content-disposition: attachment; filename=farrukh.najmi.vcf begin:vcard fn:Farrukh Najmi n:Najmi;Farrukh email;internet:farrukh.najmi@sun.com tel;work:781-442-9017 url:http://ebxmlrr.sourceforge.net/tmp/farrukhRacePointIcon.jpg version:2.1 end:vcard --Boundary_(ID_mMAWLKOgSj8II9F15iP3vQ)--