From derby-user-return-3992-apmail-db-derby-user-archive=db.apache.org@db.apache.org Wed Apr 05 17:33:05 2006 Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 10625 invoked from network); 5 Apr 2006 17:33:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Apr 2006 17:33:04 -0000 Received: (qmail 17927 invoked by uid 500); 5 Apr 2006 17:33:03 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 17705 invoked by uid 500); 5 Apr 2006 17:33:02 -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 17694 invoked by uid 99); 5 Apr 2006 17:33:02 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Apr 2006 10:33:02 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [32.97.110.151] (HELO e33.co.us.ibm.com) (32.97.110.151) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Apr 2006 10:33:01 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e33.co.us.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k35HWdq3026369 for ; Wed, 5 Apr 2006 13:32:39 -0400 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k35HTJOS248220 for ; Wed, 5 Apr 2006 11:29:19 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id k35HWdnw015976 for ; Wed, 5 Apr 2006 11:32:39 -0600 Received: from [127.0.0.1] (DMCSDJDT41P.usca.ibm.com [9.72.133.84]) by d03av04.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id k35HWc2E015708 for ; Wed, 5 Apr 2006 11:32:39 -0600 Message-ID: <4433FEF6.2000305@apache.org> Date: Wed, 05 Apr 2006 10:31:34 -0700 From: Daniel John Debrunner User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en, de MIME-Version: 1.0 To: Derby Discussion Subject: Re: PreparedStatement Persistance References: <20060405171327.94673.qmail@web31802.mail.mud.yahoo.com> In-Reply-To: <20060405171327.94673.qmail@web31802.mail.mud.yahoo.com> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Daniel Morton wrote: > Over the past few threads, someone mentioned that the > PreparedStatements are cached on the database even > when the connection that created the > PreparedStatements are closd... I was discussing that > very issue with an associate of mine a couple of weeks > ago, and he assured me that the Oracle and DB2 people > he knew told him that the PreparedStatements did not > persist between connections. Is that incorrect, or > does Derby just handle it differently? PreparedStatements are not cached in Derby, however the compiled plan of the statement is cached across connections, and can be shared across connections. It is this compiled plan that takes the significant amount of time to create. PreparedStatements are really a wrapper around the compiled plan that maintans state specific to that statement and connection. Most databases have this ability to cache the compiled plan, to avoid re-compilation across connections. Dan.