X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.acorn%2Fsrc%2Forg%2Fsimantics%2Facorn%2FGraphClientImpl2.java;h=a0c2ef860ba0353b6a1eb7ea0feabe605efb2a63;hb=refs%2Fchanges%2F75%2F2275%2F1;hp=7a57053bcf6aa9f1af09548424bfe00c59456751;hpb=751ee12501d220832b672dd433655a4d65806fd9;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/GraphClientImpl2.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/GraphClientImpl2.java index 7a57053bc..a0c2ef860 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/GraphClientImpl2.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/GraphClientImpl2.java @@ -46,7 +46,6 @@ import org.simantics.db.server.ProCoreException; import org.simantics.db.service.ClusterSetsSupport; import org.simantics.db.service.ClusterUID; import org.simantics.db.service.LifecycleSupport; -import org.simantics.utils.DataContainer; import org.simantics.utils.datastructures.Pair; import org.simantics.utils.logging.TimeLogger; import org.slf4j.Logger; @@ -68,6 +67,7 @@ public class GraphClientImpl2 implements Database.Session { private Path dbFolder; private final Database database; private ServiceLocator locator; + private FileCache fileCache; private MainProgram mainProgram; private static class ClientThreadFactory implements ThreadFactory { @@ -92,7 +92,10 @@ public class GraphClientImpl2 implements Database.Session { this.database = database; this.dbFolder = dbFolder; this.locator = locator; - this.clusters = new ClusterManager(dbFolder); + this.fileCache = new FileCache(); + // This disposes the cache when the session is shut down + locator.registerService(FileCache.class, fileCache); + this.clusters = new ClusterManager(dbFolder, fileCache); load(); ClusterSetsSupport cssi = locator.getService(ClusterSetsSupport.class); cssi.setReadDirectory(clusters.lastSessionDirectory); @@ -685,7 +688,7 @@ public class GraphClientImpl2 implements Database.Session { LOGGER.info("performUndo " + ccsid); performUndo(ccsid, clusterChanges, support); } catch (DatabaseException e) { - e.printStackTrace(); + LOGGER.error("failed to perform undo for cluster change set {}", ccsid, e); } } }