]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.browsing.ui.graph.impl/src/org/simantics/browsing/ui/graph/impl/LazyGraphLabeler.java
Merge "Multiple reader thread support for db client"
[simantics/platform.git] / bundles / org.simantics.browsing.ui.graph.impl / src / org / simantics / browsing / ui / graph / impl / LazyGraphLabeler.java
index cf410444ed7753fc9a4d6df73882211fdc811f9e..639c90391f8c73351cb9c2e86211e7755d5953d0 100644 (file)
@@ -21,10 +21,12 @@ import org.simantics.browsing.ui.PrimitiveQueryUpdater;
 import org.simantics.browsing.ui.common.labelers.LabelerContent;
 import org.simantics.browsing.ui.common.labelers.LabelerStub;
 import org.simantics.browsing.ui.graph.impl.request.ResourceQuery;
+import org.simantics.db.AsyncReadGraph;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.procedure.Listener;
 import org.simantics.utils.ui.ErrorLogger;
+import org.slf4j.Logger;
 
 public abstract class LazyGraphLabeler extends LabelerStub {
 
@@ -80,8 +82,7 @@ public abstract class LazyGraphLabeler extends LabelerStub {
 
             @Override
             public void exception(Throwable t) {
-                System.err.println("LazyGraphLabeler2: ");
-                t.printStackTrace();
+                getLogger().error("LazyGraphLabeler2: ", t);
             }
 
         };
@@ -92,7 +93,7 @@ public abstract class LazyGraphLabeler extends LabelerStub {
 
         if (content == LabelerContent.NO_CONTENT) {
 
-            final DataSource<ReadGraph> source = updater.getDataSource(ReadGraph.class);
+            final DataSource<AsyncReadGraph> source = updater.getDataSource(AsyncReadGraph.class);
             assert(source != null);
             source.schedule(graph -> graph.asyncRequest(labelQuery, procedure));
 
@@ -116,4 +117,5 @@ public abstract class LazyGraphLabeler extends LabelerStub {
 
     }
 
+    public abstract Logger getLogger();
 }