Author: toad
Date: 2008-07-12 17:29:21 +0000 (Sat, 12 Jul 2008)
New Revision: 21114

Modified:
   
branches/db4o/freenet/src/freenet/support/io/PersistentEncryptedTempBucketFactory.java
Log:
More work on Cooo's OOM

Modified: 
branches/db4o/freenet/src/freenet/support/io/PersistentEncryptedTempBucketFactory.java
===================================================================
--- 
branches/db4o/freenet/src/freenet/support/io/PersistentEncryptedTempBucketFactory.java
      2008-07-12 17:21:47 UTC (rev 21113)
+++ 
branches/db4o/freenet/src/freenet/support/io/PersistentEncryptedTempBucketFactory.java
      2008-07-12 17:29:21 UTC (rev 21114)
@@ -35,12 +35,14 @@
 //             });
                Query query = container.query();
                query.constrain(PersistentEncryptedTempBucketFactory.class);
-               query.descend("bf").constrain(persistentTempBucketFactory);
+               //query.descend("bf").constrain(persistentTempBucketFactory);
                ObjectSet results = query.execute();
-               if(results.hasNext()) {
-                       return (PersistentEncryptedTempBucketFactory) 
results.next();
-               } else {
-                       return new 
PersistentEncryptedTempBucketFactory(persistentTempBucketFactory);
+               while(results.hasNext()) {
+                       PersistentEncryptedTempBucketFactory factory = 
(PersistentEncryptedTempBucketFactory) results.next();
+                       if(factory.bf == persistentTempBucketFactory) return 
factory;
+                       System.err.println("Not matched factory");
                }
+               System.err.println("Creating new factory");
+               return new 
PersistentEncryptedTempBucketFactory(persistentTempBucketFactory);
        }
 }


Reply via email to