]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Always discard database undo history after each platform startup. 32/1532/2
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 7 Mar 2018 11:44:25 +0000 (13:44 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 7 Mar 2018 11:46:22 +0000 (13:46 +0200)
refs #7792

Change-Id: I587d095dbb65e458ff70a4cdf14001f6bee13461

bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java
bundles/org.simantics/src/org/simantics/SimanticsPlatform.java

index bce220c9c3ae24fb64f8248766f0dce4956c1f8f..9169c64b3eca5a207b58e4b5900e45708092ed21 100644 (file)
@@ -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();
 
index 54b96054719e993986a7ab6ad2e938b67fc0e430..211b286a9401e290c0f5819bf9c5d76c035f9a5b 100644 (file)
@@ -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;
 
     }