This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet instantiation  RSS feed

 
raj malhotra
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
My question is if on geting a request for a servlet,container will start preparing servlet instance.But in the middle of the process,suppose new request has come for the same servlet.How container will handle this situation.How container will know that instance instantion is already under process..

Thanks for reading this.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container will only instantiate a single of the servlet and the container will only allow access after the servlet has been instantiated. the 'how' is managed by detecting that an instance is not ready yet and stopping the other threads until the new servlet instance is ready.
 
raj malhotra
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it! Thanks David.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!