changeset 393:b7831cefbb62

Added some more debug output during the process of removing Artifacts and Collections by the DatabaseCleaner. artifacts/trunk@4585 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 05 Jun 2012 13:32:14 +0000
parents cdc8b7c64856
children c40729bfe06d
files ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java
diffstat 3 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jun 01 09:49:07 2012 +0000
+++ b/ChangeLog	Tue Jun 05 13:32:14 2012 +0000
@@ -1,3 +1,10 @@
+2012-06-05  Ingo Weinzierl <ingo@intevation.de>
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java,
+	  artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java:
+	  Added some more debug output during the process of removing Artifacts
+	  and Collections with the DatabaseCleaner.
+
 2012-06-01	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java:
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java	Fri Jun 01 09:49:07 2012 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java	Tue Jun 05 13:32:14 2012 +0000
@@ -1308,6 +1308,8 @@
                 reset();
 
                 // outdate artifacts that are only in this collection
+                logger.info("Outdate Artifacts that belong to collection: " + id);
+
                 prepareStatement(SQL_OUTDATE_ARTIFACTS_COLLECTION);
                 stmnt.setInt(1, id);
                 stmnt.setInt(2, id);
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java	Fri Jun 01 09:49:07 2012 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java	Tue Jun 05 13:32:14 2012 +0000
@@ -307,6 +307,7 @@
             stmnt = connection.prepareStatement(SQL_DELETE_COLLECTION_ITEMS);
 
             for (IdIdentifier id: cs) {
+                logger.debug("Mark collection for deletion: " + id.id);
                 stmnt.setInt(1, id.id);
                 stmnt.execute();
             }
@@ -355,17 +356,23 @@
                         idData.factoryName, idData.data);
                     idData.data = null;
 
+                    logger.debug("Prepare Artifact (id="
+                        + idData.id + ") for deletion.");
+
                     stmnt.setInt(1, idData.id);
                     stmnt.execute();
                     connection.commit();
 
                     try {
                         if (artifact != null) {
+                            logger.debug("Call endOfLife for Artifact: "
+                                + artifact.identifier());
+
                             artifact.endOfLife(context);
                         }
                     }
                     catch (Exception e) {
-                        logger.error(e.getLocalizedMessage(), e);
+                        logger.error(e.getMessage(), e);
                     }
 
                     deletedArtifacts.add(idData.identifier);

http://dive4elements.wald.intevation.org