tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cindy <>
Subject Tomcat Restart and HttpSession
Date Tue, 21 Feb 2006 06:43:29 GMT
In tomcat 5.0.29, when I shutdown and restart the appl thru the Manager, the 
HttpSession objects are NOT destroyed while the appli's ServletContext IS 
(together with other info like the set of Principal's).  Keeping the 
HttpSessions could be a good feature for maintaining the state of the web 
appli. across restart; however, sometimes the application would keep session 
related information in the ServletContext.

For example, my appli uses a HttpSessionListener to register every session 
object created/destroyed into a Map inside ServletContext.  This allow me to 
write an admin servlet to monitor the no. of active sessions by reading the 
servlet context.  But, in order to make this approach working, the no. of 
session objects must be consistent with my Map in the servlet context.  And, 
this cannot be achieved when the appli restart.

Is there a way to ensure the Servlet Context is also intact after a restart?  
Or, what approach should we take if we need to keep sessions related info into 
a global data structure whose lifespan should be the same as the sessions 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message