From: Tuukka Lehtonen Date: Fri, 16 Sep 2016 08:17:32 +0000 (+0300) Subject: Merge commit '728147df5d63a3333daff3d8c0e9bfd4f5597e3a' X-Git-Tag: v1.25.0~114 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=9b79343ca481f448a4bcdeb3c2b35af91c8dfb62;hp=-c Merge commit '728147df5d63a3333daff3d8c0e9bfd4f5597e3a' refs #6694 --- 9b79343ca481f448a4bcdeb3c2b35af91c8dfb62 diff --combined bundles/org.simantics.project/src/org/simantics/project/management/ServerManagerFactory.java index 4a673b97d,bbeb7541e..8957a2167 --- a/bundles/org.simantics.project/src/org/simantics/project/management/ServerManagerFactory.java +++ b/bundles/org.simantics.project/src/org/simantics/project/management/ServerManagerFactory.java @@@ -30,12 -30,12 +30,12 @@@ import org.simantics.db.exception.Datab import org.simantics.utils.FileUtils; public class ServerManagerFactory { - public static ServerManager create(String databaseId, String address) throws IOException, DatabaseException { - Driver driver = Manager.getDriver(databaseId); + public static ServerManager create(String databaseDriverId, String address) throws IOException, DatabaseException { + Driver driver = Manager.getDriver(databaseDriverId); if (driver == null) - throw new IllegalArgumentException("Database driver with ID " + databaseId + " could not be found!"); - System.out.println("ServerManagerFactory.create called with id " + databaseId + ", driver is " + driver.toString()); - DatabaseUserAgent agent = Manager.getUserAgent(databaseId); - throw new IllegalArgumentException("Database driver for ID " + databaseDriverId + " Could not be found!"); - System.out.println("ServerManagerFactory.create called with databaseId=" + databaseDriverId + " and driver is " + driver.toString()); ++ throw new IllegalArgumentException("Database driver with ID " + databaseDriverId + " could not be found!"); ++ System.out.println("ServerManagerFactory.create called with id " + databaseDriverId + ", driver is " + driver.toString()); + DatabaseUserAgent agent = Manager.getUserAgent(databaseDriverId); if (agent != null) driver.setDatabaseUserAgent(address, agent); return new ServerManager(driver); diff --combined bundles/org.simantics/src/org/simantics/SimanticsPlatform.java index 611cfa575,40bbc04ed..ba29a654a --- a/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java +++ b/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java @@@ -197,13 -197,13 +197,13 @@@ public class SimanticsPlatform implemen return application != null ? application : UUID.randomUUID().toString(); } - private Session setupDatabase(String databaseId, IProgressMonitor progressMonitor, RecoveryPolicy workspacePolicy, PlatformUserAgent userAgent) throws PlatformException { + private Session setupDatabase(String databaseDriverId, IProgressMonitor progressMonitor, RecoveryPolicy workspacePolicy, PlatformUserAgent userAgent) throws PlatformException { if (progressMonitor == null) progressMonitor = new NullProgressMonitor(); File dbLocation = Platform.getLocation().append("db").toFile(); ServerManager serverManager; try { - serverManager = ServerManagerFactory.create(databaseId, dbLocation.getAbsolutePath()); + serverManager = ServerManagerFactory.create(databaseDriverId, dbLocation.getAbsolutePath()); } catch (DatabaseException | IOException e) { throw new PlatformException("Failed to initialize Server Manager", e); } @@@ -284,9 -284,7 +284,9 @@@ // 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); } } @@@ -702,7 -700,7 +702,7 @@@ * startup or null to resort to default measures * @throws PlatformException */ - public SessionContext startUp(String databaseId, IProgressMonitor progressMonitor, RecoveryPolicy workspacePolicy, + public SessionContext startUp(String databaseDriverId, IProgressMonitor progressMonitor, RecoveryPolicy workspacePolicy, OntologyRecoveryPolicy ontologyPolicy, boolean requireSynchronize, PlatformUserAgent userAgent) throws PlatformException { @@@ -729,7 -727,7 +729,7 @@@ VariableRepository.clear(); // 1. Assert there is a database at /db - session = setupDatabase(databaseId, progressMonitor, workspacePolicy, userAgent); + session = setupDatabase(databaseDriverId, progressMonitor, workspacePolicy, userAgent); TimeLogger.log("Database setup complete"); // 2. Assert all graphs, and correct versions, are installed to the database @@@ -1014,9 -1012,9 +1014,9 @@@ return false; } - public void reconnect(String databaseId) throws Exception { + public void reconnect(String databaseDriverId) throws Exception { // Starts database server. - SimanticsPlatform.INSTANCE.startUp(databaseId, null, RecoveryPolicy.ThrowError, OntologyRecoveryPolicy.ThrowError, true, null); + SimanticsPlatform.INSTANCE.startUp(databaseDriverId, null, RecoveryPolicy.ThrowError, OntologyRecoveryPolicy.ThrowError, true, null); } private void dumpPlatformBundleState() {