Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 54137 invoked from network); 12 May 2008 15:53:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 May 2008 15:53:09 -0000 Received: (qmail 45974 invoked by uid 500); 12 May 2008 15:53:09 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 45945 invoked by uid 500); 12 May 2008 15:53:09 -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 45934 invoked by uid 99); 12 May 2008 15:53:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2008 08:53:09 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tian.tan0831@googlemail.com designates 72.14.220.155 as permitted sender) Received: from [72.14.220.155] (HELO fg-out-1718.google.com) (72.14.220.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 May 2008 15:52:21 +0000 Received: by fg-out-1718.google.com with SMTP id l27so2548923fgb.43 for ; Mon, 12 May 2008 08:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=tevIESL+Ynx3ZoZewlnjrCc0joNwFI6bWE0XkyG9N9M=; b=C4oCJCsjBkzWWRkuzVkUQOFOlpCot1bZOPk89MihKK3mOQEhfbdHmdVlWRFR+E1fTi+PPbxbeKAx797qiclJ07ET8qgkQ1puYpgLDob2Hf6vPBN60Awbv22eA6P5tr8u11MZR0U+RBDQXD70L4OMReDl9qQLKRI0nWSpAU4Hhkk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=vHly0QF2iDfTVeDLZc0uNDdzRn2TWjI//M5U/jMLBmPoXbw4aLWq0ob98toV9TL5t0NjdV+4Moky8wsDiwvr4M3hATkm5W1xbpggmzY+HVOjvPKfK0/ItQUcKeJbCgdg5gebYgeztr6BSk6s/mYQGu2gRnfD/PsLQqfhMmUyAjE= Received: by 10.86.94.11 with SMTP id r11mr14580109fgb.0.1210607555192; Mon, 12 May 2008 08:52:35 -0700 (PDT) Received: by 10.86.26.20 with HTTP; Mon, 12 May 2008 08:52:35 -0700 (PDT) Message-ID: Date: Mon, 12 May 2008 23:52:35 +0800 From: "Tian TAN" To: "Derby Discussion" Subject: Re: Dropped procedure still cached? In-Reply-To: <482842A9.9060300@sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <18db29d30805110714u6cdab773rf954193565628402@mail.gmail.com> <482842A9.9060300@sun.com> X-Virus-Checked: Checked by ClamAV on apache.org Okay, I see. Thanks Rick. Thanks sin(EaTing). 2008/5/12 Rick Hillegas : > Hi Tian, > > It sounds as though the old procedure class is stuck in Derby's > classloaders. This topic comes up occasionally and the user guides should > probably explain this better. > > 1) If your user-written procedures and functions live inside jar files which > you have loaded into your Derby database, then you need to replace those > jar files by invoking the sqlj.replace_jar system procedure. For more > information, please see the section titled "Storing jar files in a database" > in the Derby Tools and Utilities Guide: > http://db.apache.org/derby/docs/10.4/tools/ > > 2) If, however, your user-written procedures and functions live outside your > Derby database and are simply wired into the VM's classpath, then you need > to bring Derby down and back up in order to reload the user-written classes > which you have changed. Once Derby loads a class from the VM's classpath, > that class definition remains in the classloader until you restart Derby. > > Hope this helps, > -Rick > > Tian TAN wrote: >> >> My class just look like the one below. I did re-run it to make sure >> the class file is changed and clean. Am I missing something here? >> >> package derbylab; >> >> public class TestProcedure { >> public static void main(String[] args){ >> print(); >> } >> >> public static void print(){ >> System.out.println("AAA"); >> } >> } >> >> >> 2008/5/11 sin(EaTing), : >> >>> >>> You need to reimport your jar containing the procedure definition? >>> >>> On Sun, May 11, 2008 at 9:28 PM, Tian TAN >>> wrote: >>> >>>> >>>> Hi all, >>>> >>>> I am new to derby and I recently encountering the following problem, >>>> can someone help (by explaining a bit or pointing me to some doc)? >>>> >>>> Environment >>>> I am running derby server using eclipse plugin, and issuing the SQL >>>> through ij. >>>> >>>> Step 1 >>>> >>>> connect 'jdbc:derby://localhost:1527/testDB;create=true;'; >>>> >>>> CREATE PROCEDURE testPrint ( ) >>>> MODIFIES SQL DATA >>>> PARAMETER STYLE JAVA >>>> LANGUAGE JAVA >>>> EXTERNAL NAME 'derbylab.TestProcedure.print' -- print 'AAA' in the Java >>>> class >>>> ; >>>> >>>> CALL testPrint(); >>>> >>>> Statement executed correctly and prints out 'AAA. >>>> >>>> Step 2 >>>> Then I changed the print 'AAA' in the Java class to print 'BBB' and >>>> execute >>>> >>>> connect 'jdbc:derby://localhost:1527/testDB;create=true;'; >>>> >>>> DROP PROCEDURE testPrint; >>>> CALL testPrint(); -- make sure it's dropped. No surprise ERROR 42Y03 >>>> Procedure not found. >>>> >>>> CREATE PROCEDURE testPrint ( ) >>>> MODIFIES SQL DATA >>>> PARAMETER STYLE JAVA >>>> LANGUAGE JAVA >>>> EXTERNAL NAME 'derbylab.TestProcedure.print' >>>> --- now I expect it to print 'BBB', since I've changed the Java class >>>> ; >>>> CALL testPrint(); >>>> Statement executed but still prints out 'AAA' instead of 'BBB'. >>>> >>>> This is a bit surprise to me. I noticed that in between step 1 and >>>> step2 if I restart derby network server the result is correct. So it >>>> seems to me that the testPrint PROCEDURE is cached and not dropped? >>>> (i.e. if the exact same testPrint PROCEDURE is recreated the old >>>> cached version will be called). >>>> >>>> Could someone help? (or pointing me to some online doc or some source >>>> code I should look? ) Thanks. >>>> >>>> Tim >>>> >>> >>> > >