changeset 382:e07d1c3f7667

Flush/persist cache at end of program. flys-artifacts/trunk@1798 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 02 May 2011 16:50:58 +0000
parents 52b6de9d0ab4
children dcc3cd962c0e
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/cache/CacheFactory.java flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java
diffstat 3 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon May 02 16:44:02 2011 +0000
+++ b/flys-artifacts/ChangeLog	Mon May 02 16:50:58 2011 +0000
@@ -1,3 +1,11 @@
+2011-05-02	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/cache/CacheFactory.java:
+	  Flush/persist caches at program exists.
+
+	* src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java:
+	  Commented out too eloquent debug output.
+
 2011-05-02  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/cache/CacheFactory.java	Mon May 02 16:44:02 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/cache/CacheFactory.java	Mon May 02 16:50:58 2011 +0000
@@ -38,6 +38,11 @@
                     //  "net.sf.ehcache.enableShutdownHook", "true");
                     Runtime.getRuntime().addShutdownHook(new Thread() {
                         public void run() {
+                            log.info("shutting down caches");
+                            for (String name: cacheManager.getCacheNames()) {
+                                log.info("\tflushing '" + name + "'");
+                                cacheManager.getCache(name).flush();
+                            }
                             cacheManager.shutdown();
                         }
                     });
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Mon May 02 16:44:02 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Mon May 02 16:50:58 2011 +0000
@@ -148,7 +148,7 @@
             for (int i = 0; i < size; i++) {
                 target = tmp.get(i, target);
 
-                logger.debug("++ W Tuple: " + target[2] + " -> " + target[0]);
+                //logger.debug("++ W Tuple: " + target[2] + " -> " + target[0]);
                 series.add(target[2], target[0]);
             }
 
@@ -183,7 +183,7 @@
             for (int i = 0; i < size; i++) {
                 target = tmp.get(i, target);
 
-                logger.debug("++ Q Tuple: " + target[2] + " -> " + target[1]);
+                //logger.debug("++ Q Tuple: " + target[2] + " -> " + target[1]);
                 series.add(target[2], target[1]);
             }
 

http://dive4elements.wald.intevation.org