Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Execution of destroy method in a servlet by a container

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Assume tha i opened a web application did some opertaions on the servlet .and i logged out .

Will the container will call the destroy method of that servlet immedately (Assuming the servlet is not serving any other client at that particular time).


 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Almost certainly not. Although the servlet container probably will not call the method until the web app (or the complete server) is shut down, it is free to take servlets out of service any time it feels like it (after calling destroy, of course). It's at best possible to make guesses about when that will happen, not predictions. The servlet code must be written to take into account that init and destroy may be called multiple times at unpredictable intervals.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you .

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic