From a333f3b6f20b4d16e159eed4b4bbb4656b28488b Mon Sep 17 00:00:00 2001 From: Antti Villberg Date: Mon, 12 Dec 2016 11:56:51 +0200 Subject: [PATCH] An attempt to resolve this issue for good refs #6169 Change-Id: Ia06d08568fa37b9a575f924dc35be5fe3fa1a941 --- ...reamingTransferableGraphImportProcess.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphImportProcess.java b/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphImportProcess.java index 3d4b78977..a043e59f7 100644 --- a/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphImportProcess.java +++ b/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphImportProcess.java @@ -37,6 +37,7 @@ import org.simantics.db.VirtualGraph; import org.simantics.db.WriteOnlyGraph; import org.simantics.db.common.WriteBindings; import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener; +import org.simantics.db.common.request.PossibleIndexRoot; import org.simantics.db.common.uri.UnescapedChildMapOfResource; import org.simantics.db.common.utils.Logger; import org.simantics.db.exception.DatabaseException; @@ -210,7 +211,9 @@ public class StreamingTransferableGraphImportProcess implements TransferableGrap void prepare(ReadGraph graph) throws Exception { -// indexRoot = graph.syncRequest(new PossibleIndexRoot(((IImportAdvisor2)advisor).getTarget())); + Resource target = advisor.getTarget(); + if(target != null) + indexRoot = graph.syncRequest(new PossibleIndexRoot(target)); findBuiltins(graph); readIdentities(graph); @@ -316,7 +319,7 @@ public class StreamingTransferableGraphImportProcess implements TransferableGrap return resourceUtil.mayHaveResource(type); } - void findClusterSet(WriteOnlyGraph graph, Resource rootLibrary, Resource indexRoot, int[] clustering, int[] clusterSets, long[] clusters, int id) throws DatabaseException { + void findClusterSet(WriteOnlyGraph graph, Resource rootLibrary, int[] clustering, int[] clusterSets, long[] clusters, int id) throws DatabaseException { ClusteringSupport support = graph.getService(ClusteringSupport.class); if(id == Extensions.ROOT_LIBRARY_CLUSTER_SET || id == Extensions.INDEX_ROOT_CLUSTER_SET) return; for(int pos=0,index=0;index