Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 67637 invoked from network); 30 Apr 2007 10:08:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Apr 2007 10:08:18 -0000 Received: (qmail 21309 invoked by uid 500); 30 Apr 2007 10:08:24 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 21283 invoked by uid 500); 30 Apr 2007 10:08:23 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 21271 invoked by uid 99); 30 Apr 2007 10:08:23 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Apr 2007 03:08:23 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [192.18.1.36] (HELO gmp-ea-fw-1.sun.com) (192.18.1.36) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Apr 2007 03:08:15 -0700 Received: from d1-emea-09.sun.com (d1-emea-09.sun.com [192.18.2.119]) by gmp-ea-fw-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id l3UA7ruA023092 for ; Mon, 30 Apr 2007 10:07:53 GMT Received: from conversion-daemon.d1-emea-09.sun.com by d1-emea-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0JHB00M012PUMT00@d1-emea-09.sun.com> (original mail from Knut.Hatlen@Sun.COM) for derby-dev@db.apache.org; Mon, 30 Apr 2007 11:07:53 +0100 (BST) Received: from localhost ([129.159.112.231]) by d1-emea-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0JHB00H4L2T3NQG0@d1-emea-09.sun.com>; Mon, 30 Apr 2007 11:07:52 +0100 (BST) Date: Mon, 30 Apr 2007 12:07:51 +0200 From: Knut Anders Hatlen Subject: Re: upgrade and compiled statements in SYSSTATEMENTS - question In-reply-to: <4634BF8E.7020203@sbcglobal.net> Sender: Knut.Hatlen@Sun.COM To: derby-dev@db.apache.org Cc: mikem_app@sbcglobal.net Message-id: Organization: Sun Microsystems MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT References: <4632A232.7080709@sbcglobal.net> <4634BF8E.7020203@sbcglobal.net> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.98 (usg-unix-v) X-Virus-Checked: Checked by ClamAV on apache.org Mike Matrigali writes: > Knut.Hatlen@Sun.COM wrote: >> Mike Matrigali writes: >> >> >>>My assumption for both soft and hard upgrade on changes to >>>objects in compiled parts of queries was that I did not have >>>to worry about upgrade. That any change to query plan data >>>structures stored on disk would be taken care of automatically >>>by just dropping them on any release number change. >>> >>>Is that valid? >> >> >> If you by "any release number change" mean change of major or minor >> release number, yes. On soft upgrade, the queries will be read directly >> from org/apache/derby/impl/jdbc/metadata.properties or >> org/apache/derby/impl/sql/catalog/metadata_net.properties. On hard >> upgrade, the statements in SYSSTATEMENTS will be dropped, re-read from >> metadata(_net).properties and recompiled. >> >> There are some more details on the wiki: >> http://wiki.apache.org/db-derby/MetadataUpgrade > > Thanks for the pointer. From the wiki it seems like we don't drop > SYSSTATEMENTS for soft upgrade. That's correct. We don't drop them since we want to be able to go back to the old version without needing any downgrade code. > It also sounds like we prevent reads > from SYSSTATEMENTS for soft upgrade. Yes, since the queries might have been changed between the versions we cannot use the old ones in SYSSTATEMENTS. > Is there meant to be something > preventing writes to SYSSTATEMENTS for soft upgrade (ie. is there > anything preventing recompile from updating SYSSTATEMENTS)? To my knowledge, there is nothing that prevents writes to SYSSTATEMENTS (except the mechanism that prevents metadata calls from using it), but I thought SYSSTATEMENTS was only written to during database creation and hard upgrade. And recompiles shouldn't happen as long as the metadata calls don't use the stored statements, right? There could of course be code (even user code) that executes the statements directly, but I'm not aware of any part of the Derby code doing that. -- Knut Anders