diff --git a/com.cubrid.cubridmanager.ui/src/com/cubrid/cubridmanager/ui/host/action/EditHostAction.java b/com.cubrid.cubridmanager.ui/src/com/cubrid/cubridmanager/ui/host/action/EditHostAction.java index b6a78db5..9a1220a1 100644 --- a/com.cubrid.cubridmanager.ui/src/com/cubrid/cubridmanager/ui/host/action/EditHostAction.java +++ b/com.cubrid.cubridmanager.ui/src/com/cubrid/cubridmanager/ui/host/action/EditHostAction.java @@ -203,7 +203,7 @@ public void doRun(CubridServer[] servers, boolean actionIsConnect) { LOGGER.error("newServerInfo is null."); continue; } - + if (!newServerInfo.getServerName().equals(server.getLabel())) { QueryOptions.removePref(server.getServerInfo()); brokerManager.removeAllBrokerIntervalSettingInServer(server.getLabel()); @@ -227,6 +227,7 @@ public void doRun(CubridServer[] servers, boolean actionIsConnect) { server.setId(newServerInfo.getServerName()); server.setLabel(newServerInfo.getServerName()); + server.setUniqueName(newServerInfo.getServerName()); CMHostNodePersistManager.getInstance().addServer( newServerInfo.getHostAddress(), newServerInfo.getHostMonPort(), @@ -302,8 +303,13 @@ public void doRun(CubridServer[] servers, boolean actionIsConnect) { HostUtils.processHostDisconnected(server); } + if (!serverInfo.getHostAddress().equals(server.getServerInfo().getHostAddress())) { + CMHostNodePersistManager.getInstance().removeServer(server); + } + server.setId(serverInfo.getServerName()); server.setLabel(serverInfo.getServerName()); + server.setUniqueName(serverInfo.getServerName()); server.setServerInfo(serverInfo); server.setAutoSavePassword(dialog.isSavePassword()); CMHostNodePersistManager.getInstance().addServer(serverInfo.getHostAddress(), diff --git a/com.cubrid.cubridmanager.ui/src/com/cubrid/cubridmanager/ui/host/action/RenameHostAction.java b/com.cubrid.cubridmanager.ui/src/com/cubrid/cubridmanager/ui/host/action/RenameHostAction.java index 47628984..64cd15e1 100644 --- a/com.cubrid.cubridmanager.ui/src/com/cubrid/cubridmanager/ui/host/action/RenameHostAction.java +++ b/com.cubrid.cubridmanager.ui/src/com/cubrid/cubridmanager/ui/host/action/RenameHostAction.java @@ -112,6 +112,7 @@ private void doRun(CubridServer server) { int ret = dlg.open(); if (ret == IDialogConstants.OK_ID) { server.setLabel(dlg.getNewName()); + server.setUniqueName(dlg.getNewName()); server.getServerInfo().setServerName(dlg.getNewName()); CubridNavigatorView navigatorView = CubridNavigatorView.getNavigatorView(CubridHostNavigatorView.ID); TreeViewer treeViewer = navigatorView == null ? null : navigatorView.getViewer(); diff --git a/com.cubrid.cubridmanager.ui/src/com/cubrid/cubridmanager/ui/host/dialog/HostDialog.java b/com.cubrid.cubridmanager.ui/src/com/cubrid/cubridmanager/ui/host/dialog/HostDialog.java index 6b8a7b6f..c74ac528 100644 --- a/com.cubrid.cubridmanager.ui/src/com/cubrid/cubridmanager/ui/host/dialog/HostDialog.java +++ b/com.cubrid.cubridmanager.ui/src/com/cubrid/cubridmanager/ui/host/dialog/HostDialog.java @@ -513,6 +513,7 @@ protected void buttonPressed(int buttonId) { CommonUITool.openInformationBox(Messages.msgSaveAndClose); server.setLabel(serverInfo.getServerName()); + server.setUniqueName(serverInfo.getServerName()); /*Save operate at the action*/ QueryOptions.setAutoCommit(serverInfo, btnAutoCommit.getSelection()); diff --git a/com.cubrid.cubridquery.ui/src/com/cubrid/cubridquery/ui/connection/action/RenameConnectionAction.java b/com.cubrid.cubridquery.ui/src/com/cubrid/cubridquery/ui/connection/action/RenameConnectionAction.java index 67eec677..127f11c5 100644 --- a/com.cubrid.cubridquery.ui/src/com/cubrid/cubridquery/ui/connection/action/RenameConnectionAction.java +++ b/com.cubrid.cubridquery.ui/src/com/cubrid/cubridquery/ui/connection/action/RenameConnectionAction.java @@ -161,6 +161,7 @@ private void doRun(CubridDatabase database) { } database.setLabel(dlg.getNewName()); + database.setUniqueName(dlg.getNewName()); database.setLogined(false); CubridNavigatorView navigatorView = CubridNavigatorView.getNavigatorView(CubridQueryNavigatorView.ID); diff --git a/com.cubrid.cubridquery.ui/src/com/cubrid/cubridquery/ui/connection/dialog/QueryConnDialog.java b/com.cubrid.cubridquery.ui/src/com/cubrid/cubridquery/ui/connection/dialog/QueryConnDialog.java index b4f08bd3..e110813e 100644 --- a/com.cubrid.cubridquery.ui/src/com/cubrid/cubridquery/ui/connection/dialog/QueryConnDialog.java +++ b/com.cubrid.cubridquery.ui/src/com/cubrid/cubridquery/ui/connection/dialog/QueryConnDialog.java @@ -420,6 +420,7 @@ protected void buttonPressed(int buttonId) { } else { database.setId(dbId); database.setLabel(name); + database.setUniqueName(name); } database.setDatabaseInfo(dbInfo); database.setServer(server);