Hi Aaron,

We preserve session state through hot and cold deploys with no problem, 
unless you explicitly change the objects involved in keeping the session 
state, or any object that is stored in the context. However, it is not 
impossible to modify these objects while preserving your state, as long 
as you know how to handle serialisation issues. If you are careful with 
the classes you put in sessions and the context ( make them serializable 
and take into account the possible evolution of classes ) then you will 
minimize your problems.
Have a look at the "Object Serialization" part of the Java SDK 
Documentation to learn more about that.

BTW: The attribute to get persistence to work in Orion is not 
development=true but persistence-path="../temp/persistence.ser". So your 
  global-web-application.xml should look something like...
<orion-web-app
         ...
        persistence-path="../temp/persistence.ser"
         ...
 >
...

I hope it helps,
D.

Aaron Tavistock wrote:

> I'm not currently doing hot-deploy, but I've always wonder how it could
> posibly work given that a serialized class might have the underlying base
> class changed during hot-deploy (e.g. the classic 'run instance' is
> different than a 'new instance' problem that java throws a
> ClassCastException from).  Its also theoretically problematic (I'm not sure
> if instanceof or reflection will work properly).
> 
> Since this is a very low-level issue (e.g. Java simply doesn't have the
> facilities to really handle this), how does hot-deply work?  The only
> reliable strategy would appear to be to preserver primatives (since they
> don't change), maybe preserve 'well-defined' objects (java.util.* is
> unlikely to change), and discard all the rest.
> 
> Any thoughts? 
> 
> AT
> 
> -----Original Message-----
> From: Peter Beck [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 29, 2002 7:41 AM
> To: Orion-Interest
> Subject: hot redeployment - how to preserve session state?
> 
> 
> After a forced redeployment of an application on Orion 1.5.3 by touching 
> application.xml
> my session state seemst to be completely lost.
> 
> I have set development=true in my global-web-application.xml, and the 
> switch is present in the orion-web.xml in the application- deployment 
> directory.
> The variables I try to serialize implement the Serializable interface. 
> Some of them are simple JavaBeans, others just Strings.
> 
> For testing I use a JSP which prints the variables in the session. 
> Before the redeployment everything is there.
> and when a user is logged in, request.getRemoteUser() gives me the 
> correct user name.
> After the redeployment session.toString() still gives me the same ID as 
> before, but all variables in the session are gone.
> Even request.getRemoteUser() == null.
> 
> What am I missing?
> 
> Peter



Reply via email to