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=7e6bd9dd9be5c7c134baff73223061f535ce6e92;hp=40bbc04ed3e7ba70dac8648d5b8aaa6c56458ebc;hb=ffdf83729b496d5afe74c7888075bb17ce1c4bbb;hpb=728147df5d63a3333daff3d8c0e9bfd4f5597e3a diff --git a/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java b/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java index 40bbc04ed..7e6bd9dd9 100644 --- a/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java +++ b/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java @@ -284,7 +284,9 @@ public class SimanticsPlatform implements LifecycleListener { // Check hash of transferable graph to know whether to update or not. if (platformBundle.getHashcode() == existingBundle.getHashcode()) continue; - System.out.println("Ontology hashcodes does not match! platformBundle" + platformBundle.getName() + ".getHashCode()=" + platformBundle.getHashcode() + " existingBundle" + existingBundle.getName() + ".getHashCode()=" + existingBundle.getHashcode()); + //System.out.println("Ontology hashcodes do not match: platform bundle=" + // + platformBundle.getVersionedId() + ", hash=" + platformBundle.getHashcode() + // + "; existing bundle=" + existingBundle.getVersionedId() + ", hash=" + existingBundle.getHashcode()); reinstallTGs.put(platformBundle, existingBundle); } } @@ -397,7 +399,7 @@ public class SimanticsPlatform implements LifecycleListener { boolean changes = TransferableGraphs.hasChanges(readGraph(), oldResources, delta); endTransaction(); if (!changes) { - log.log(new Status(IStatus.INFO, Activator.PLUGIN_ID, "Nothing to merge for "+tg.toString())); + //log.log(new Status(IStatus.INFO, Activator.PLUGIN_ID, "Nothing to merge for "+tg.toString())); continue; } @@ -729,7 +731,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");