Title: RE: ServletSession's and Servlet Reloading
Actually, it is possible.  Session's are not lost in Websphere when you recompile any of the classes... servlet or otherwise.  I'm not reloading the session, just a single servlet (which of course can access the session).  No, something else is going on here.  Either classloaders aren't arranged properly in a chain or the reload process is mistakenly causing all sessions to be invalidated.

[Scott Lawrence]  -----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Hani Suleiman
Sent: Tuesday, August 08, 2000 10:03 AM
To: Orion-Interest
Subject: RE: ServletSession's and Servlet Reloading

This behaviour actually makes a lot of sense when you consider how classloaders work in java. It is impossible to throw away any given class, in order to do ANY reloading of anything at all, you need to throw away the classloader, and make a new one and load classes through it. Now, another factor to throw into the mix is that in order for two classes to be equal, they must have the same class, AND be loaded through the same classloader. Hence, when you've reloaded classes, all classes in your session are now invalid. There is no way around this, I'm afraid! The solution is to ensure that things are initialised properly in your servlet startup code. Eg, where you first create the session, make sure you invalidate the existing one.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Scott Lawrence
Sent: Monday, August 07, 2000 11:12 PM
To: Orion-Interest
Subject: ServletSession's and Servlet Reloading



Orion 1.1.37 (as well as all other versions as far as I remember) lose the
Servlet Session whenever a servlet is reloaded.

Why is this?  Is this an issue with how classloaders are used?  This makes
working with complex sessions very difficult to test and debug since each
time I recompile a servlet, I'll lose the session when that servlet is
reloaded.  Other servers do not destroy the session (Websphere for instance)
when reloading servlets.  Have I missed something or is there a setting that
prevents this from happening?

Reply via email to