[freenet-cvs] r12025 - trunk/freenet/src/freenet/store

toad at freenetproject.org toad at freenetproject.org
Thu Mar 8 00:17:44 UTC 2007


Author: toad
Date: 2007-03-08 00:17:24 +0000 (Thu, 08 Mar 2007)
New Revision: 12025

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

Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java	2007-03-08 00:11:16 UTC (rev 12024)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java	2007-03-08 00:17:24 UTC (rev 12025)
@@ -1491,12 +1491,22 @@
 	        	hits++;
 	        }
 	    	return block;
-    	}catch(Throwable ex) {  // FIXME: ugly  
+    	} catch(Throwable ex) {  // FIXME: ugly
+    		// Clean up.
+    		// Reports of wierd NPEs when aborting a transaction, deal with it
     		if(c!=null) {
-    			try{c.close();}catch(DatabaseException ex2){}
+    			try {
+    				c.close();
+    			} catch(Throwable ex2) { 
+    				Logger.error(this, "Caught "+ex2+" closing in finally block", ex2);
+    			}
     		}
     		if(t!=null) {
-    			try{t.abort();}catch(DatabaseException ex2){}
+    			try {
+    				t.abort();
+    			} catch(Throwable ex2) {
+    				Logger.error(this, "Caught "+ex2+" aborting in finally block", ex2);
+    			}
     		}
         	checkSecondaryDatabaseError(ex);
     		Logger.error(this, "Caught "+ex, ex);




More information about the cvs mailing list