Author: shuber
Date: Thu Sep 27 11:23:21 2007
New Revision: 18687

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18687&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:
    trunk/core/src/java/org/jahia/services/cache/ehcache/EhCacheImpl.java

Modified: trunk/core/src/java/org/jahia/services/cache/ehcache/EhCacheImpl.=
java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/services/cache/ehcache/EhCacheImpl.java&rev=3D18687&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
--- trunk/core/src/java/org/jahia/services/cache/ehcache/EhCacheImpl.java (=
original)
+++ trunk/core/src/java/org/jahia/services/cache/ehcache/EhCacheImpl.java T=
hu Sep 27 11:23:21 2007
@@ -42,7 +42,9 @@
     }
 =

     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) {

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

Reply via email to