bobh 2002/08/28 10:08:58 Modified: catalina/src/share/org/apache/catalina/session StoreBase.java PersistentManagerBase.java Log: Currently when backup's of sessions expire they take out the session in RAM along with them. This patch fixes this problem. Revision Changes Path 1.6 +11 -5 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StoreBase.java Index: StoreBase.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StoreBase.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- StoreBase.java 9 Jun 2002 02:19:43 -0000 1.5 +++ StoreBase.java 28 Aug 2002 17:08:58 -0000 1.6 @@ -313,7 +313,13 @@ int timeIdle = // Truncate, do not round up (int) ((timeNow - session.getLastAccessedTime()) / 1000L); if (timeIdle >= maxInactiveInterval) { - session.expire(); + if ( ( (PersistentManagerBase) manager).isLoaded( keys[i] )) { + // recycle old backup session + session.recycle(); + } else { + // expire swapped out session + session.expire(); + } remove(session.getId()); } } catch (IOException e) { 1.9 +24 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/PersistentManagerBase.java Index: PersistentManagerBase.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/PersistentManagerBase.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- PersistentManagerBase.java 9 Jun 2002 02:19:43 -0000 1.8 +++ PersistentManagerBase.java 28 Aug 2002 17:08:58 -0000 1.9 @@ -551,6 +551,26 @@ /** + * Return true, if the session id is loaded in memory + * otherwise false is returned + * + * @param id The session id for the session to be searched for + * + * @exception IOException if an input/output error occurs while + * processing this request + */ + public boolean isLoaded( String id ){ + try { + if ( super.findSession(id) != null ) + return true; + } catch (IOException e) { + log("checking isLoaded for id, " + id + ", "+e.getMessage(), e); + } + return false; + } + + + /** * Return the active Session, associated with this Manager, with the * specified session id (if any); otherwise return <code>null</code>. * This method checks the persistence store if persistence is enabled,
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>