diff gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputStateBase.java @ 1030:c07d9f9a738c

Removed bugs that existed in the caching mechanism (issue264, issue268). gnv-artifacts/trunk@1067 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 06 May 2010 08:32:56 +0000
parents 499cfbbb61bc
children cc4ec127d666
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputStateBase.java	Tue May 04 14:24:23 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputStateBase.java	Thu May 06 08:32:56 2010 +0000
@@ -209,7 +209,7 @@
             // we use a cache
             log.info("Using cache.");
             Cache cache = factory.getCache();
-            String key  = "chart_" + getHash();
+            String key  = "chart_" + getHash(uuid);
 
             net.sf.ehcache.Element value = cache.get(key);
             if (value != null) {
@@ -242,7 +242,7 @@
         log.debug("Fetch chart [" + uuid + "] from cache");
         CacheFactory cacheFactory = CacheFactory.getInstance();
         if (cacheFactory.isInitialized()) {
-            String key = "chart_" + getHash();
+            String key = "chart_" + getHash(uuid);
             net.sf.ehcache.Element object = cacheFactory.getCache().get(key);
 
             if (object != null) {
@@ -302,7 +302,7 @@
     protected void removeChartResult(String uuid) {
         log.debug("OutputStateBase.getChartResult");
         if (CacheFactory.getInstance().isInitialized()) {
-            String key = "chart_" + getHash();
+            String key = "chart_" + getHash(uuid);
             log.debug("Hash for Queryelements: " + key);
             net.sf.ehcache.Element value = CacheFactory.getInstance().getCache().get(key);
             if (value != null) {
@@ -321,7 +321,7 @@
 
         CacheFactory cacheFactory = CacheFactory.getInstance();
         if (cacheFactory.isInitialized()) {
-            String key = "chart_" + getHash();
+            String key = "chart_" + getHash(uuid);
             net.sf.ehcache.Element object = cacheFactory.getCache().get(key);
             if (object != null)
                 cacheFactory.getCache().remove(key);
@@ -335,7 +335,7 @@
         log.debug("Prufify chart [" + uuid + "]");
         CacheFactory cacheFactory = CacheFactory.getInstance();
         if (cacheFactory.isInitialized()) {
-            String key = "chart_" + getHash();
+            String key = "chart_" + getHash(uuid);
             cacheFactory.getCache().put(new net.sf.ehcache.Element(key, chart));
         }
     }

http://dive4elements.wald.intevation.org