billbarker    2002/08/29 22:41:42

  Modified:    src/share/org/apache/tomcat/modules/session
                        SimpleSessionStore.java
  Log:
  Switch the order between copy and Serialize.
  
  Reloading is an expensive operation in any case.  By doing serialize first, we 
handle the case where the session value is e.g. a Hashtable or Vector which contains 
(a Serializable) value loaded with the old Webapp Classloader.
  
  Revision  Changes    Path
  1.21      +5 -4      
jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SimpleSessionStore.java
  
  Index: SimpleSessionStore.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SimpleSessionStore.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- SimpleSessionStore.java   21 Aug 2002 04:11:56 -0000      1.20
  +++ SimpleSessionStore.java   30 Aug 2002 05:41:42 -0000      1.21
  @@ -147,14 +147,15 @@
        while( e.hasMoreElements() )   {
            String key = (String) e.nextElement();
            Object value = session.getAttribute(key);
  -         if( value.getClass().getClassLoader() != oldCL ) {
  -             // it's loaded by the parent loader, no need to reload
  -             newSession.put( key, value );
  -         } else if ( value instanceof Serializable ) {
  +         if ( value instanceof Serializable ) {
                Object newValue =
                    ObjectSerializer.doSerialization( newCL,
                                                      value);
                newSession.put( key, newValue );
  +         } 
  +         else if( value.getClass().getClassLoader() != oldCL ) {
  +             // it's loaded by the parent loader, no need to reload
  +             newSession.put( key, value );
            } 
        }
        // If saving back to the same session.
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to