db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tian TAN" <tian.tan0...@googlemail.com>
Subject Re: Dropped procedure still cached?
Date Mon, 12 May 2008 01:03:42 GMT
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), <ussraf@gmail.com>:
> You need to reimport your jar containing the procedure definition?
>
> On Sun, May 11, 2008 at 9:28 PM, Tian TAN <tian.tan0831@googlemail.com>
> 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
>
>

Mime
View raw message