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...
--- Geoffrey Talvola <[EMAIL PROTECTED]>
wrote:

> You can put startup code in awake() and cleanup code
> in sleep() methods of a
> servlet.  These methods get called at the beginning
> and end of every request
> for that servlet.  For example:
>  
>  
> class MyPage(Page):
>     def awake(self, trans):
>         Page.awake(self, trans)
>         # your code goes here
>  
>     def sleep(self, trans):
>         # Your cleanup code goes here
>         Page.sleep(self, trans)
>  
> The servlets never get deleted until the app server
> is shut down -- they get
> reused instead.  That's why you have to put your
> cleanup code in sleep()
> instead of __del__().
>  
> - Geoff
> 
> -----Original Message-----
> From: Meh Lounge [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 22, 2004 9:46 AM
> To: Geoffrey Talvola;
> [EMAIL PROTECTED]
> Subject: RE: [Webware-discuss] __del__ equivalent
> webware function
> 
> 
> But how can I add this thing per servlet?
> I'm having a servlet (or context) that opens a DB
> connection when started
> and need to close it when it is done. Can't I add a
> close() function to the
> context/servlet? this should be changed IMHO.
> 
> Geoffrey Talvola <[EMAIL PROTECTED]> wrote:
> 
> Meh Lounge wrote:
> > Can anyone please provide me with such function.
> How
> > can I order webware to do thing when a servlet or
> when
> > a context is closed?
> 
> You can call Application.addShutDownHandler(func)
> where func is any callable
> object. It will be called when the app server is
> shut down.
> 
> - Geoff
> 
> 
>
-------------------------------------------------------
> 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
> 
> 
> 
> 
>   _____  
> 
> Do you Yahoo!?
> vote.yahoo.com <http://vote.yahoo.com>  - Register
> online to vote today!
> 
> 



                
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com


-------------------------------------------------------
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

Reply via email to