File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes is destroy() called in case of power failure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "is destroy() called in case of power failure" Watch "is destroy() called in case of power failure" New topic

is destroy() called in case of power failure

prabhu gupte

Joined: Nov 28, 2004
Posts: 4
Hi everybody,
I want to know whether the Servlet's destroy() method is called when there is a power failure.The scenario is that a servlet instance is loaded and is processing client requests and suddenly the power failure occurs(On the server side). Now, does the Servlet container or the APPlication server call the destroy() method of the servlet and unload its instance.
Also, What happens when the Server restarts.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

If you're running your servlet container as a service or a daemon and you have a UPS that is configured to shut down the machine that it's running on in the event of a power outage, then yes, it would be the same as stopping the daemon or service by hand.

If you just pull the plug on the server and it has no UPS, then no.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: is destroy() called in case of power failure
Similar Threads
explicit call to destroy() ....possible???
destroy method
When a Servlet destroy method is called.
when the destroy() methid caled
Unload event for Tomcat