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.