import org.simantics.db.layer0.variable.VariableRepository;
import org.simantics.db.management.SessionContext;
import org.simantics.db.request.Read;
+import org.simantics.db.request.Write;
import org.simantics.db.service.LifecycleSupport.LifecycleListener;
import org.simantics.db.service.LifecycleSupport.LifecycleState;
import org.simantics.db.service.QueryControl;
}
throw new PlatformException(sb.toString());
}
-
+
List<GraphBundle> sortedBundles = analyzer.getSortedGraphs();
if(!sortedBundles.isEmpty()) {
-
- session.syncRequest(new WriteRequest() {
- @Override
- public void perform(WriteGraph graph) throws DatabaseException {
- try {
- graph.newClusterSet(graph.getRootLibrary());
- } catch (ClusterSetExistException e) {
- // Cluster set exist already, no problem.
- }
- graph.setClusterSet4NewResource(graph.getRootLibrary());
- graph.flushCluster();
+
+ session.syncRequest((Write) graph -> {
+ try {
+ graph.newClusterSet(graph.getRootLibrary());
+ } catch (ClusterSetExistException e) {
+ // Cluster set exist already, no problem.
}
+ graph.setClusterSet4NewResource(graph.getRootLibrary());
+ graph.flushCluster();
});
boolean mergedOntologies = false;
}
}
}
-
- session.syncRequest(new WriteRequest() {
- @Override
- public void perform(WriteGraph graph) throws DatabaseException {
- graph.setClusterSet4NewResource(graph.getRootLibrary());
- graph.flushCluster();
- }
+
+ session.syncRequest((Write) graph -> {
+ graph.setClusterSet4NewResource(graph.getRootLibrary());
+ graph.flushCluster();
});
if (mergedOntologies)
Collection<GroupReference> groupsWithoutVersion = GroupReference.stripVersions(publishedFeatureGroups);
try {
- Transaction.startTransaction(session, true);
- try {
- Projects.setProjectInstalledGroups(writeGraph(), projectResource, groupsWithoutVersion);
- Transaction.commit();
- } finally {
- Transaction.endTransaction();
- }
- //session.getService( LifecycleSupport.class ).save();
- } catch(DatabaseException ae) {
+ session.syncRequest(
+ (Write) graph ->
+ Projects.setProjectInstalledGroups(graph, projectResource, groupsWithoutVersion));
+ } catch (DatabaseException ae) {
throw new PlatformException("Failed to install features", ae);
}
progressMonitor.worked(10);
installProject = assertProject(progressMonitor, workspacePolicy, installProject);
// 6. Install all features into project, if in debug mode
- updateInstalledGroups(progressMonitor, installProject);
+ updateInstalledGroups(progressMonitor, true); //installProject);
TimeLogger.log("Installed all features into project");
// 7. Assert L0.Session in database for this session
session.getService(XSupport.class).setServiceMode(false, false);
try {
- session.sync(new WriteRequest() {
-
- @Override
- public void perform(WriteGraph graph) throws DatabaseException {
- QueryControl qc = graph.getService(QueryControl.class);
- qc.flush(graph);
- }
-
+ session.syncRequest((Write) graph -> {
+ QueryControl qc = graph.getService(QueryControl.class);
+ qc.flush(graph);
});
TimeLogger.log("Flushed queries");
} catch (DatabaseException e) {