GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE  >  Servlets
Go To First  |  Previous Question  |  Next Question 
 Servlets  |  Question 73 of 170    Print  
Consider a scenario in which 4 users are accessing a servlet instance. Among which one user called destroy() method. What happens to the rest 3 users?

  
Total Answers and Comments: 4 Last Update: March 04, 2008     Asked by: Sohamsri 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: K M Rameshkumar
 
This is not possible as the destroy() can only invoked by the container, Which always makes sure there is no client is being processed before executing destroy().

Above answer was rated as good by the following members:
phdsong
November 27, 2005 02:07:37   
ravi        

RE: Consider a scenario in which 4 users are accessing...

Hi

We know that by default servlet is multithreaded for every client request a new thread will be created and assigned to that to perform the service. so if one thread initiates destroy() only itself will be terminated but other threads not terminates.

Other wise it is against to servlet spec. regarding multithreading concept. ex: suppose if u open 2 browser instances for a website if u move from one site to another in one browser the other remains connect to same site not terminates.


 
Is this answer useful? Yes | No
January 12, 2006 05:09:36   
K M Rameshkumar        

RE: Consider a scenario in which 4 users are accessing...
This is not possible as the destroy() can only invoked by the container Which always makes sure there is no client is being processed before executing destroy().
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
June 20, 2007 09:25:32   
dgshivas Member Since: June 2007   Contribution: 5    

RE: Consider a scenario in which 4 users are accessing...

We can't call directly destroy() method container will not support that.


 
Is this answer useful? Yes | No
March 04, 2008 02:55:23   
sampra Member Since: February 2008   Contribution: 278    

RE: Consider a scenario in which 4 users are accessing a servlet instance. Among which one user called destroy() method. What happens to the rest 3 users?
if there are 4 user and one has distroy the thred then thread which he is using only that will be distroy rest will be keep alive
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape