X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2FSCL.java;fp=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2FSCL.java;h=24e50c0f7606c2cdde27fefdb0fb8a20a2d32d65;hp=bfa42b40e18707e020bd27b0d0a9fb9de3654a8f;hb=5930811a7911090a0c4984380c3b45ed81a93cde;hpb=5134e3d53a652adc5b1936c17fe3ec6fb8ef433e diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/SCL.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/SCL.java index bfa42b40e..24e50c0f7 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/SCL.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/SCL.java @@ -16,13 +16,13 @@ import org.simantics.SimanticsPlatform.OntologyRecoveryPolicy; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.WriteGraph; -import org.simantics.db.common.request.ReadRequest; import org.simantics.db.common.request.WriteRequest; import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.request.external.EclipsePreferencePrimitiveRead; import org.simantics.db.layer0.util.RemoverUtil; import org.simantics.db.layer0.util.SimanticsClipboard; import org.simantics.db.service.DebugSupport; +import org.simantics.db.service.ServiceActivityMonitor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -64,29 +64,33 @@ public class SCL { // but unfortunately this does not work either... // so we synchronize by a familiar write transaction // And then wait still some more - for(int i=0;i<3;i++) { - Simantics.getSession().syncRequest(new WriteRequest() { - @Override - public void perform(WriteGraph graph) throws DatabaseException { - } - - @Override - public String toString() { - return "Utils sync"; - } - }); - - // And then wait still some more - Simantics.getSession().syncRequest(new ReadRequest() { - @Override - public void run(ReadGraph graph) throws DatabaseException { - } - }); - } +// for(int i=0;i<3;i++) { + Simantics.getSession().syncRequest(new WriteRequest() { + @Override + public void perform(WriteGraph graph) throws DatabaseException { + } + + @Override + public String toString() { + return "Utils sync"; + } + }); +// +// // And then wait still some more +// Simantics.getSession().syncRequest(new ReadRequest() { +// @Override +// public void run(ReadGraph graph) throws DatabaseException { +// } +// }); +// } } public static void syncGraph() throws Exception { - sync(); + try { + Simantics.getSession().getService(ServiceActivityMonitor.class).waitForCompletion(); + } catch (InterruptedException e) { + throw new DatabaseException(e); + } // OK, now the experiment activate job should be scheduled // Wait for the job to finish