changeset 315:03e508e57b85

Generate kill events if and only if there were killed collections or artifacts. artifacts/trunk@2448 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 02 Aug 2011 11:41:11 +0000
parents 31ee2b3b5a57
children 0ca9b1073ccf
files ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Aug 02 11:11:59 2011 +0000
+++ b/ChangeLog	Tue Aug 02 11:41:11 2011 +0000
@@ -1,3 +1,8 @@
+2011-08-02	Sascha L. Teichmann	<teichmann@intevation.de>
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java:
+	  Generate kill events if and only if there were killed collections or artifacts.
+
 2011-08-02	Sascha L. Teichmann	<teichmann@intevation.de>
 
 	* artifact-database/src/main/resources/sql/org-h2-driver.properties,
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java	Tue Aug 02 11:11:59 2011 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java	Tue Aug 02 11:41:11 2011 +0000
@@ -394,8 +394,13 @@
             }
         }
 
-        reviver.killedCollections(deletedCollections);
-        reviver.killedArtifacts(deletedArtifacts);
+        if (!deletedCollections.isEmpty()) {
+            reviver.killedCollections(deletedCollections);
+        }
+
+        if (!deletedArtifacts.isEmpty()) {
+            reviver.killedArtifacts(deletedArtifacts);
+        }
 
         if (logger.isDebugEnabled()) {
             logger.debug(

http://dive4elements.wald.intevation.org