Merge branch 'hotfix/Hotfix-1'
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -55,6 +55,7 @@ public class EmsCoreDBLoader {
|
||||
public void init() throws Exception {
|
||||
this.settingsController.addOnConfigUpdated(() -> {
|
||||
try {
|
||||
connectionPool.destroy();
|
||||
connectionPool.init();
|
||||
load(null);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -96,7 +96,12 @@ public class BasicConnectionPool {
|
||||
throw new IllegalArgumentException("No datasource registered for profile: " + connectionsModel.getProfileName());
|
||||
}
|
||||
|
||||
return ds.getConnection();
|
||||
Connection connection = ds.getConnection();
|
||||
if (!connection.getCatalog().equalsIgnoreCase(dbName)) {
|
||||
throw new IllegalArgumentException("Connection for profile " + connectionsModel.getProfileName() + " is not for database " + dbName);
|
||||
}
|
||||
|
||||
return connection;
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
|
||||
Reference in New Issue
Block a user