Author: toad
Date: 2007-03-30 20:41:28 +0000 (Fri, 30 Mar 2007)
New Revision: 12456

Modified:
   trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
More logging

Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2007-03-30 
20:20:30 UTC (rev 12455)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2007-03-30 
20:41:28 UTC (rev 12456)
@@ -1123,17 +1123,23 @@
                try {
                        environment.removeDatabase(null, prefix+"CHK");
                } catch (DatabaseException e) {
-                       Logger.error(this, "Could not remove old database: "+e, 
e);
+                       Logger.error(this, "Could not remove old database: 
"+(prefix+"CHK")+": "+e, e);
+                       System.err.println("Could not remove old database: 
"+(prefix+"CHK")+": "+e);
+                       e.printStackTrace();
                }
                try {
                        environment.removeDatabase(null, 
prefix+"CHK_accessTime");
                } catch (DatabaseException e) {
                        Logger.error(this, "Could not remove old database 
accesstime: "+e, e);
+                       System.err.println("Could not remove old database: 
"+(prefix+"CHK_accessTime")+": "+e);
+                       e.printStackTrace();
                }
                try {
                        environment.removeDatabase(null, prefix+"CHK_blockNum");
                } catch (DatabaseException e) {
                        Logger.error(this, "Could not remove old database 
blocknum: "+e, e);
+                       System.err.println("Could not remove old database: 
"+(prefix+"CHK_blockNum")+": "+e);
+                       e.printStackTrace();
                }
                System.err.println("Removed old database "+prefix);

@@ -1201,6 +1207,8 @@
        }

        private void reconstruct(short type) throws DatabaseException, 
IOException {
+               if(chkDB.count() != 0)
+                       throw new IllegalStateException("Store must be empty 
before reconstruction!");
                if(type == TYPE_SSK) {
                        System.err.println("Reconstruction of SSK store not 
supported at present.");
                        throw new UnsupportedOperationException("Reconstruction 
of SSK store not supported at present.");


Reply via email to