From: Tuukka Lehtonen Date: Wed, 7 Mar 2018 11:44:25 +0000 (+0200) Subject: Always discard database undo history after each platform startup. X-Git-Tag: v1.43.0~136^2~559 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F32%2F1532%2F2;p=simantics%2Fplatform.git Always discard database undo history after each platform startup. refs #7792 Change-Id: I587d095dbb65e458ff70a4cdf14001f6bee13461 --- diff --git a/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java b/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java index bce220c9c..9169c64b3 100644 --- a/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java +++ b/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java @@ -341,12 +341,6 @@ public class SimanticsWorkbenchAdvisor extends WorkbenchAdvisor { // Start the database garbage collector after a short while. SessionGarbageCollectorJob.getInstance().scheduleAfterQuietTime(); - // Discard database session undo history at this point to prevent - // the user from undoing any initialization operations performed - // by the platform startup. - SimanticsPlatform.INSTANCE.discardSessionUndoHistory(); - TimeLogger.log("Discarded session undo history"); - // #6353: Workaround for fixBindings(); diff --git a/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java b/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java index 54b960547..211b286a9 100644 --- a/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java +++ b/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java @@ -65,7 +65,6 @@ import org.simantics.db.VirtualGraph; import org.simantics.db.WriteGraph; import org.simantics.db.common.request.ObjectsWithType; import org.simantics.db.common.request.Queries; -import org.simantics.db.common.request.WriteRequest; import org.simantics.db.common.request.WriteResultRequest; import org.simantics.db.common.utils.Transaction; import org.simantics.db.exception.ClusterSetExistException; @@ -914,6 +913,12 @@ public class SimanticsPlatform implements LifecycleListener { // #7650: improve shutdown robustness in all applications that use the platform Runtime.getRuntime().addShutdownHook(shutdownHook); + // Discard database session undo history at this point to prevent + // the user from undoing any initialization operations performed + // by the platform startup. + SimanticsPlatform.INSTANCE.discardSessionUndoHistory(); + TimeLogger.log("Discarded session undo history"); + return sessionContext; }