#294 shutdown command execution


I use JSW with HSQLDB and docs say i must connect to server and execute "shutdown" to terminate service correctly. Is there some way of doing it from within wrapper? maybe unknown to me option in config-file or something?..

Thanks in advance!


  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2011-11-22

    One more thing : i need this command executed when user stop service via system tools like "services" console in "management" or "net service stop" command in command line

  • Christian Mueller


    Sorry I'm not quite sure on what you trying to do.
    Do you want to know on how to shutdown the Wrapper with its API/configuration properties (from within)?
    or do you want to run a "shutdown" command, which is an external command (shell script/program etc.) at the time the Wrapper is shutting down?


  • Leif Mortenson

    Leif Mortenson - 2011-11-23

    Are you referring to the "SHUTDOWN" or "SHUTDOWN COMPACT" commands which can be sent to the HSQL DB to tell it to shutdown cleanly?

    If so, the Wrapper does not have any special support for HSQLDB. But there are a couple ways for you to do this.

    1) Create a new "Shutdown Hook" which will use your JDBC connection to the DB to send the SHUTDOWN command. When the Wrapper tries to shutdown the JVM for any reason, the JVM will execute all of its shutdown hooks. You need to make sure that the Wrapper's wrapper.jvm_exit.timeout property is long enough for all shutdown hooks to complete cleanly. I would suggest a System.out.println("HSQLDB Down") log entry at the end so you can debug this easily.
    This method is the easiest as it will not require any Wrapper specific coding.

    2) You can also implement your own WrapperListener implementation. See Method #3.
    This will let you control the shutdown a bit more, but you will still need to send the SHUTDOWN command to the DB and wait for it to return.

    I hope this helps.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks