From 571533bb34f06bbe3e868dd730d4cf5e793039a4 Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Wed, 7 Mar 2018 13:44:25 +0200 Subject: [PATCH 1/1] Always discard database undo history after each platform startup. refs #7792 Change-Id: I587d095dbb65e458ff70a4cdf14001f6bee13461 --- .../workbench/internal/SimanticsWorkbenchAdvisor.java | 6 ------ .../org.simantics/src/org/simantics/SimanticsPlatform.java | 7 ++++++- 2 files changed, 6 insertions(+), 7 deletions(-) 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; } -- 2.43.2