Author: toad
Date: 2007-03-30 20:57:17 +0000 (Fri, 30 Mar 2007)
New Revision: 12459
Modified:
trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
DatabaseNotFoundException when we are trying to blank it out anyway is fine
Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2007-03-30
20:47:59 UTC (rev 12458)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2007-03-30
20:57:17 UTC (rev 12459)
@@ -444,6 +444,7 @@
if(wipe) {
wipeOldDatabases(prefix);
}
+
chkDB = environment.openDatabase(null,prefix+"CHK",dbConfig);
this.fixSecondaryFile = fixSecondaryFile;
@@ -460,8 +461,16 @@
// it won't overflow ... or we debug the wrapper.
// NB: it might be a wrapper-version-missmatch problem
(nextgens)
try {
- environment.truncateDatabase(null,
prefix+"CHK_accessTime", false);
- environment.truncateDatabase(null,
prefix+"CHK_blockNum", false);
+ try {
+ environment.truncateDatabase(null,
prefix+"CHK_accessTime", false);
+ } catch (DatabaseNotFoundException e) {
+ // Cool!
+ }
+ try {
+ environment.truncateDatabase(null,
prefix+"CHK_blockNum", false);
+ } catch (DatabaseNotFoundException e) {
+ // Cool!
+ }
} catch (DatabaseException e) {
close(false);
throw e;
@@ -1135,9 +1144,6 @@
(null,
prefix+"CHK_accessTime", chkDB, secDbConfig);
// Initialize other secondary database sorted on block number
- try {
- environment.removeDatabase(null, prefix+"CHK_blockNum");
- } catch (DatabaseNotFoundException e) { };
SecondaryConfig blockNoDbConfig = new SecondaryConfig();
blockNoDbConfig.setAllowCreate(true);
blockNoDbConfig.setSortedDuplicates(false);