]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics/src/org/simantics/SimanticsPlatform.java
Sync git svn branch with SVN repository r33249.
[simantics/platform.git] / bundles / org.simantics / src / org / simantics / SimanticsPlatform.java
index ba29a654a461370360c61ee399963363ff1e6e7f..7e6bd9dd9be5c7c134baff73223061f535ce6e92 100644 (file)
@@ -284,9 +284,9 @@ public class SimanticsPlatform implements LifecycleListener {
                     // Check hash of transferable graph to know whether to update or not.\r
                     if (platformBundle.getHashcode() == existingBundle.getHashcode())\r
                         continue;\r
-                    System.out.println("Ontology hashcodes do not match: platform bundle="\r
-                            + platformBundle.getVersionedId() + ", hash=" + platformBundle.getHashcode()\r
-                            + "; existing bundle=" + existingBundle.getVersionedId() + ", hash=" + existingBundle.getHashcode());\r
+                    //System.out.println("Ontology hashcodes do not match: platform bundle="\r
+                    //        + platformBundle.getVersionedId() + ", hash=" + platformBundle.getHashcode()\r
+                    //        + "; existing bundle=" + existingBundle.getVersionedId() + ", hash=" + existingBundle.getHashcode());\r
                     reinstallTGs.put(platformBundle, existingBundle);\r
                 }\r
             }\r
@@ -399,7 +399,7 @@ public class SimanticsPlatform implements LifecycleListener {
                                        boolean changes = TransferableGraphs.hasChanges(readGraph(), oldResources, delta);\r
                                        endTransaction();\r
                                        if (!changes) {\r
-                                           log.log(new Status(IStatus.INFO, Activator.PLUGIN_ID, "Nothing to merge for "+tg.toString()));\r
+                                           //log.log(new Status(IStatus.INFO, Activator.PLUGIN_ID, "Nothing to merge for "+tg.toString()));\r
                                            continue;\r
                                        }\r
 \r
@@ -731,7 +731,17 @@ public class SimanticsPlatform implements LifecycleListener {
         // 1. Assert there is a database at <workspace>/db\r
         session = setupDatabase(databaseDriverId, progressMonitor, workspacePolicy, userAgent);\r
         TimeLogger.log("Database setup complete");\r
-\r
+        \r
+        // 1.1 \r
+        XSupport support = session.getService(XSupport.class);\r
+        if (support.rolledback()) {\r
+            try {\r
+                DatabaseIndexing.deleteAllIndexes();\r
+            } catch (IOException e) {\r
+                throw new PlatformException(e);\r
+            }\r
+        }\r
+        \r
         // 2. Assert all graphs, and correct versions, are installed to the database\r
         synchronizeOntologies(progressMonitor, ontologyPolicy, requireSynchronize);\r
         TimeLogger.log("Synchronized ontologies");\r