Originally posted by Chih-Wei Lee:
Alex, thanks for your response.
I have taken a look Andrew's book about ShutdownHook.
but I don't understand why he create a new database and lock the database
when server shutdown.
So what do you do when the server shutdown?
do you also lock the database?
Thanks
Lee
Hi,
unfortunalty, I don't have Andrew's book with me, I don't know what you are refering to. It might be specific to the example.
The Shutdown hook should be used to stop/close anything cleanly.. Since the assignment is quite simple, it could mean making sure
- the remote object is unbound;
- the file is closed;
- ...
I wouldn't do anything about "locking database"..
Nothing too fancy, just think what must be performed when your application is closing..
Regards,
Alex