X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics%2Fsrc%2Forg%2Fsimantics%2FSimanticsPlatform.java;h=11013eaf7e32ffd1f09fbc4477ed074c2dad21e7;hp=d59fff9c2fa85de2ef1afb2eab3e18bbd8a16f12;hb=5930811a7911090a0c4984380c3b45ed81a93cde;hpb=bcbe7aa23f42b82ff6fe4304943193c04858096c diff --git a/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java b/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java index d59fff9c2..11013eaf7 100644 --- a/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java +++ b/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java @@ -103,6 +103,7 @@ import org.simantics.project.management.WorkspaceUtil; import org.simantics.utils.FileUtils; import org.simantics.utils.datastructures.Pair; import org.simantics.utils.logging.TimeLogger; +import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** @@ -131,7 +132,7 @@ import org.slf4j.LoggerFactory; */ public class SimanticsPlatform implements LifecycleListener { - private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(SimanticsPlatform.class); + private static final Logger LOGGER = LoggerFactory.getLogger(SimanticsPlatform.class); /** * The policy is relevant when developing Simantics from Eclipse IDE. @@ -736,7 +737,17 @@ public class SimanticsPlatform implements LifecycleListener { // 1. Assert there is a database at /db session = setupDatabase(databaseDriverId, progressMonitor, workspacePolicy, userAgent); TimeLogger.log("Database setup complete"); - + + // 1.1 + XSupport support = session.getService(XSupport.class); + if (support.rolledback()) { + try { + DatabaseIndexing.deleteAllIndexes(); + } catch (IOException e) { + throw new PlatformException(e); + } + } + // 2. Assert all graphs, and correct versions, are installed to the database synchronizeOntologies(progressMonitor, ontologyPolicy, requireSynchronize); TimeLogger.log("Synchronized ontologies"); @@ -768,7 +779,7 @@ public class SimanticsPlatform implements LifecycleListener { }); TimeLogger.log("Flushed queries"); } catch (DatabaseException e) { - Logger.defaultLogError(e); + LOGGER.error("Flushing queries failed.", e); } boolean loadProject = true; try { @@ -809,7 +820,7 @@ public class SimanticsPlatform implements LifecycleListener { } } catch (DatabaseException e) { - Logger.defaultLogError(e); + LOGGER.error("Platform startup failed.", e); throw new PlatformException(e); } catch (ProjectException e) { boolean hasStackTrace = e.getStackTrace().length > 0; @@ -931,7 +942,7 @@ public class SimanticsPlatform implements LifecycleListener { try { Simantics.flushIndexCaches(progress.newChild(20), s); } catch (Throwable t) { - Logger.defaultLogError(t); + LOGGER.error("Failed to flush index caches.", t); } } @@ -972,7 +983,7 @@ public class SimanticsPlatform implements LifecycleListener { if (null != databasebManagement) databasebManagement.shutdown(); } catch (Throwable t) { - Logger.defaultLogError(t); + LOGGER.error("Database shutdown failed.", t); } progress.worked(10); @@ -980,7 +991,7 @@ public class SimanticsPlatform implements LifecycleListener { try { Simantics.clearTemporaryDirectory(); } catch (Throwable t) { - Logger.defaultLogError(t); + LOGGER.error("Failed to clear the temporary directory.", t); } progress.worked(10); if (null != platformException)