calling destroy() inside a service() method of a servlet instance
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Friday, November 22, 2002 10:50 AM

Consider a situation where web-container comes through the destroy method in service method and tries killing the instance( garbage-collecting) , then how will the container behave at that time. still not clear as to ???

cheers rajesh

Re: calling destroy() inside a service() method of a servlet instance

Posted By:   Alex_Chaffee  
Posted On:   Monday, November 25, 2002 04:38 PM

Rajesh, did you read Can destroy() be called from inside the service() method of my servlet?


The web container will never "come through the destroy method in service method", if I understand what you mean. The container will wait a reasonable amount of time for an existing request to exit service, then call destroy, then release its pointer to the servlet. Then much much later, the JVM may try to garbage collect. If the request thread is still running in that instance, it will not be garbage collected. But if it is, that's a serious problem in your architecture. You should instead take pains to exit from service() in a reasonable amount of time.

About | Sitemap | Contact