Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51614
authorkfujino <kfujino@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 4 Aug 2011 11:45:53 +0000 (11:45 +0000)
committerkfujino <kfujino@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 4 Aug 2011 11:45:53 +0000 (11:45 +0000)
Avoid two times calls of store.load() and session.expire() in PersistentManager.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1153854 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/session/StoreBase.java
webapps/docs/changelog.xml

index 178619e..b61b914 100644 (file)
@@ -168,12 +168,16 @@ public abstract class StoreBase extends LifecycleBase implements Store {
                     manager.getContainer().getLogger().debug(getStoreName()+ ": processExpires expire store session " + keys[i] );
                 }
                 boolean isLoaded = false;
-                try {
-                    if (manager.findSession(keys[i]) != null) {
-                        isLoaded = true;
+                if (manager instanceof PersistentManagerBase) {
+                    isLoaded = ((PersistentManagerBase) manager).isLoaded(keys[i]);
+                } else {
+                    try {
+                        if (manager.findSession(keys[i]) != null) {
+                            isLoaded = true;
+                        }
+                    } catch (IOException ioe) {
+                        // Ignore - session will be expired
                     }
-                } catch (IOException ioe) {
-                    // Ignore - session will be expired
                 }
                 if (isLoaded) {
                     // recycle old backup session
index b707999..98f0fd9 100644 (file)
         Allow to have several AccessLogValve instances in the same scope (e.g.
         in the same Context). (kkolinko)
       </fix>
+      <fix>
+        <bug>51614</bug>: Avoid two times calls of store.load() and 
+        session.expire() in PersistentManager. (kfujino)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">