Author: toad
Date: 2008-05-20 14:56:44 +0000 (Tue, 20 May 2008)
New Revision: 19968

Modified:
   branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java
Log:
Add a container to the ClientRequestScheduler. Each one has its own, and they 
are long-lived so need to be carefully refreshed.

Modified: 
branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java  
2008-05-20 14:54:13 UTC (rev 19967)
+++ branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java  
2008-05-20 14:56:44 UTC (rev 19968)
@@ -8,6 +8,8 @@
 import java.util.HashSet;
 import java.util.LinkedList;

+import com.db4o.ObjectContainer;
+
 import freenet.config.EnumerableOptionCallback;
 import freenet.config.InvalidConfigValueException;
 import freenet.config.SubConfig;
@@ -78,6 +80,12 @@
                }
        }

+       /** Long-lived container for use by the selector thread.
+        * We commit when we move a request to a lower retry level.
+        * We need to refresh objects when we activate them.
+        */
+       final ObjectContainer selectorContainer;
+       
        /**
         * Structure:
         * array (by priority) -> // one element per possible priority
@@ -161,6 +169,7 @@
        };

        public ClientRequestScheduler(boolean forInserts, boolean forSSKs, 
RandomSource random, RequestStarter starter, Node node, NodeClientCore core, 
SubConfig sc, String name) {
+               this.selectorContainer = node.dbServer.openClient();
                this.starter = starter;
                this.random = random;
                this.node = node;


Reply via email to