Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2002
    Posts
    2

    Unanswered: avoiding restart in SP

    Is there a way to avoid the stop/start of database instance in order to get the JAVA stored procedure to become refreshed?

    I've written a JAVA stored procedure, created a JAR file and then I deploy it to the server using the following steps after connecting: (I
    use replace_jar instead of install_jar because I installed it before)

    1. db2 call sqlj.replace_jar( 'file:myfile.jar', 'mypackage' )
    2. db2 call sqlj.refresh_classes(void)

    I create a link to the procedure:

    3.CREATE PROCEDURE MyProc( IN param1 VARCHAR(254), IN param2 INT ) EXTERNAL
    NAME
    'MYPACKAGE:MYCLASS:MyProc' RESULT SETS 0 LANGUAGE JAVA PARAMETER STYLE JAVA
    FENCED

    4. I have to stop/start the database instance in order to run my new
    procedure. If I don't do that the older version is executed.

    Is there any magical way to skip stop/start of the database instance,
    or maybe it's possible to do from the db2cmd prompt (commands like db2 stop force don't work on my NT4 box)?

    Thanks for any suggestions,
    Kris

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: avoiding restart in SP

    Try after setting the dbm cfg parameter KEEPDARI=NO

    HTH

    Cheers

    Sathyaram
    Originally posted by Cysio
    Is there a way to avoid the stop/start of database instance in order to get the JAVA stored procedure to become refreshed?

    I've written a JAVA stored procedure, created a JAR file and then I deploy it to the server using the following steps after connecting: (I
    use replace_jar instead of install_jar because I installed it before)

    1. db2 call sqlj.replace_jar( 'file:myfile.jar', 'mypackage' )
    2. db2 call sqlj.refresh_classes(void)

    I create a link to the procedure:

    3.CREATE PROCEDURE MyProc( IN param1 VARCHAR(254), IN param2 INT ) EXTERNAL
    NAME
    'MYPACKAGE:MYCLASS:MyProc' RESULT SETS 0 LANGUAGE JAVA PARAMETER STYLE JAVA
    FENCED

    4. I have to stop/start the database instance in order to run my new
    procedure. If I don't do that the older version is executed.

    Is there any magical way to skip stop/start of the database instance,
    or maybe it's possible to do from the db2cmd prompt (commands like db2 stop force don't work on my NT4 box)?

    Thanks for any suggestions,
    Kris

  3. #3
    Join Date
    Aug 2002
    Posts
    2

    finally solved!

    Thanx for your reply, but unfortunatelly it didn't help.
    I was able to achieve the result in different way:

    Instead of replace_jar I use:

    0. check in system tables if jar is already loaded, if not skip to point 4.
    1. call sqlj.refresh_classes(void)
    2. call sqlj.remove_jar(void)
    3. call sqlj.refresh_classes(void)

    4. call sqlj.install_jar(...)
    5. call sqlj.refresh_classes(void)


    The most important thing here was point 1 - I had to refresh classes before removing the package. I was not doing this and remove_jar (although successfull) didn't remove it and the old version was somehow still available to my C++ program.

    Cysio

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •