Author: toad
Date: 2008-10-04 19:37:03 +0000 (Sat, 04 Oct 2008)
New Revision: 22944

Modified:
   branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java
Log:
Fix activation NPE


Modified: 
branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java     
2008-10-04 19:35:01 UTC (rev 22943)
+++ branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java     
2008-10-04 19:37:03 UTC (rev 22944)
@@ -186,6 +186,8 @@
                        Logger.error(this, "Unknown LowLevelPutException code: 
"+e.code);
                        errors.inc(InsertException.INTERNAL_ERROR);
                }
+               if(persistent)
+                       container.activate(ctx, 1);
                if(e.code == LowLevelPutException.ROUTE_NOT_FOUND || e.code == 
LowLevelPutException.ROUTE_REALLY_NOT_FOUND) {
                        consecutiveRNFs++;
                        if(logMINOR) Logger.minor(this, "Consecutive RNFs: 
"+consecutiveRNFs+" / "+ctx.consecutiveRNFsCountAsSuccess);
@@ -200,10 +202,14 @@
                retries++;
                if((retries > ctx.maxInsertRetries) && (ctx.maxInsertRetries != 
-1)) {
                        fail(InsertException.construct(errors), container, 
context);
+                       if(persistent)
+                               container.deactivate(ctx, 1);
                        return;
                }
-               if(persistent)
+               if(persistent) {
                        container.store(this);
+                       container.deactivate(ctx, 1);
+               }
                getScheduler(context).registerInsert(this, persistent, false, 
true, container);
        }



Reply via email to