]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/CacheEntry.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / query / CacheEntry.java
index 8489256225da47bfa52c2aa29940ffbba386e24b..a650f32ce8dc6ee1f70166cbb3e21c31b6604f17 100644 (file)
@@ -11,6 +11,8 @@
  *******************************************************************************/
 package org.simantics.db.impl.query;
 
+import java.util.Collection;
+
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.impl.graph.ReadGraphImpl;
 
@@ -29,7 +31,7 @@ public abstract class CacheEntry<Procedure> {
 
     abstract void setReady();
     abstract void refute();
-    abstract void setPending();
+    abstract void setPending(QuerySupport querySupport);
     abstract void discard();
     abstract void except(Throwable t);
     abstract void clearResult(QuerySupport support);
@@ -40,10 +42,11 @@ public abstract class CacheEntry<Procedure> {
     abstract Query getQuery();
 
     abstract CacheEntry pruneFirstParents();
+    abstract void pruneParentSet();
     abstract void removeParent(CacheEntry entry);
     abstract void addParent(CacheEntry entry);
     abstract boolean hasParents();
-    abstract Iterable<CacheEntry<?>> getParents(QueryProcessor processor);
+    abstract Collection<CacheEntry<?>> getParents(QueryProcessor processor);
     abstract CacheEntry getFirstParent(QueryProcessor processor);
     abstract boolean moreThanOneParent(QueryProcessor processor);
     abstract int parentCount(QueryProcessor processor);