changeset 993:aabcca7aeb6c

Fixed datacage db scheme. add some debug output. flys-artifacts/trunk@2426 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 31 Jul 2011 16:49:48 +0000
parents 5b467bc27eda
children 3f9d46dd259c
files flys-artifacts/ChangeLog flys-artifacts/doc/conf/datacage.sql flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/Datacage.java
diffstat 3 files changed, 22 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Fri Jul 29 13:29:29 2011 +0000
+++ b/flys-artifacts/ChangeLog	Sun Jul 31 16:49:48 2011 +0000
@@ -1,3 +1,10 @@
+2011-07-29  Sascha L. Teichmann <sascha.teichmann@intevation.de>
+
+	* doc/conf/datacage.sql: Fixed constraint.
+
+	* src/main/java/de/intevation/flys/artifacts/datacage/Datacage.java:
+	  Added some debug output.
+
 2011-07-29  Sascha L. Teichmann <sascha.teichmann@intevation.de>
 
 	* doc/conf/datacage.sql: Removed artifact_id from facet because there
--- a/flys-artifacts/doc/conf/datacage.sql	Fri Jul 29 13:29:29 2011 +0000
+++ b/flys-artifacts/doc/conf/datacage.sql	Sun Jul 31 16:49:48 2011 +0000
@@ -62,7 +62,7 @@
     num         INT             NOT NULL,
     state       VARCHAR(256)    NOT NULL,
     description VARCHAR(256),
-    UNIQUE (artifact_id, out_id, num, name)
+    UNIQUE (out_id, num, name)
 );
 
 -- DROP SEQUENCE USERS_ID_SEQ;
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/Datacage.java	Fri Jul 29 13:29:29 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/Datacage.java	Sun Jul 31 16:49:48 2011 +0000
@@ -437,6 +437,7 @@
         }
 
         public boolean scan(ArtifactDatabase adb) {
+            log.debug("scan");
             try {
                 adb.loadAllArtifacts(this);
             }
@@ -508,8 +509,9 @@
 
     @Override
     public void systemUp(GlobalContext context) {
-        log.debug("systemUp");
+        log.debug("systemUp entered");
         initialScan(context);
+        log.debug("systemUp leaved");
     }
 
     protected void initialScan(GlobalContext context) {
@@ -540,15 +542,25 @@
 
     protected boolean cleanDatabase() {
 
-        return sqlExecutor.new Instance() {
+        log.debug("cleanDatabase");
+
+        boolean success = sqlExecutor.new Instance() {
             @Override
             public boolean doIt() throws SQLException {
+                log.debug("doIt");
                 prepareStatement(SQL_DELETE_ALL_USERS);
+                log.debug("prepareStatement");
                 stmnt.execute();
+                log.debug("execute");
                 conn.commit();
+                log.debug("commit");
                 return true;
             }
         }.runWrite();
+
+        log.debug("after runWrite(): " + success);
+
+        return success;
     }
 
 

http://dive4elements.wald.intevation.org