]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexUtils.java
Add locking for IndexUtils.flushIndexCaches
[simantics/platform.git] / bundles / org.simantics.db.indexing / src / org / simantics / db / indexing / IndexUtils.java
index 760acd68c465578b269cdf12e164dafbb65a2516..0cb5d9c4d9f5a78fedb3d8038bc1785bcbc6bb88 100644 (file)
@@ -119,23 +119,20 @@ public class IndexUtils {
         }
         return results;
     }
-    
-    public static void flushIndexCaches(IProgressMonitor progress, Session session) throws Exception {
 
-       MemoryIndexing mem = MemoryIndexing.getInstance(session);
-       mem.flush(progress);
-       
+    public static void flushIndexCaches(IProgressMonitor monitor, Session session) throws Exception {
+        session.getService(IndexedRelations.class).flush(monitor, session);
     }
-    
+
     public static List<Object> list(IProgressMonitor progress, Session session, Resource indexRoot) throws Exception {
-       
+
        if(progress == null) progress = new NullProgressMonitor();
 
        MemoryIndexing mem = MemoryIndexing.getInstance(session);
        Layer0X L0X = Layer0X.getInstance(session);
 
-       mem.flush(progress);
-               
+       session.getService(IndexedRelations.class).flush(progress, session);
+
        IndexedRelationsSearcher searcher = mem.get(session, L0X.DependenciesRelation, indexRoot);
         List<Object> results;
         try {