Did you try the __del__() function?
The problem is that servlets are re-used, as Geoff mentioned. They're not destructed after they run. Even if __del__ works, it won't necessarily work the way that you want.
If you just want to explicitly shut down the database connection, you'll have to wait for the stop of the AppServer, or rig-up your own "grab-and-let-go" system to handle the database connections. Even if you don't want to close them during sleep(), you could let go of them and return them to a pool.
Meh Lounge wrote:
I don't want to reopen database connection upon every
request, it is too time-consuming, I just want to be
sure that my database is intact when I shut down my
server. Java servlet use destructor for that.
Capice?
I'll use shutdownhandler...
------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss