Author: shuber
Date: Thu Sep 27 11:11:01 2007
New Revision: 18684

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18684&repname=
=3Djahia
Log:
Fix for JAHIA-2287, JAHIA-2288
EHCache was returning true on calls to isKeyInCache for expired keys. Repla=
ced this with a get call. Tested under load with 10'000 pages site and 3 mi=
nute expiration and it seems to resolve the problems.

Modified:
    branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cache/ehc=
ache/EhCacheImpl.java

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cac=
he/ehcache/EhCacheImpl.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/services/cache/ehcache/EhCacheImpl.java&rev=
=3D18684&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cache/ehc=
ache/EhCacheImpl.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/cache/ehc=
ache/EhCacheImpl.java Thu Sep 27 11:11:01 2007
@@ -42,12 +42,14 @@
     }
 =

     public boolean containsKey(Object key) {
-        return ehCache.isKeyInCache(key);
+        // we cannot use EHCache's isKeyInCache because the element might =
have expired, so we use
+        // an actual retrival to test for expiration.
+        return get(key) !=3D null;
     }
 =

     public Object get(Object key) {
         Element element =3D ehCache.get(key);
-        if (element !=3D null) {
+        if (element !=3D null) {    =

             return element.getValue();
         } else {
             return null;

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to