Quellcode durchsuchen

修复删除数据源bug

郭志波 vor 6 Jahren
Ursprung
Commit
e6c4fea9c8
1 geänderte Dateien mit 10 neuen und 11 gelöschten Zeilen
  1. 10 11
      src/main/java/com/leanwo/management/DataSourceSettingFrame.java

+ 10 - 11
src/main/java/com/leanwo/management/DataSourceSettingFrame.java

@@ -204,17 +204,16 @@ public class DataSourceSettingFrame extends JFrame {
 		//修ServerManagement程序管理器application.yml的参数
 		try {
 			updateYml( dataSourceConfigs);
+			updateApplicationXml(map);
+			// 根据dataSourceConfigs修改各个服务器中applicationContext.xml里面的数据
+			stringBuilder.append("xxx的配置,");
+			// 可以参考XmlConfigPathService中的方法
+			stringBuilder.append("请重新启动本程序。");
+			// 如果您修改了配置,请重新启动本程序
+			JOptionPane.showMessageDialog(this, stringBuilder.toString(), "提示:重新启动", JOptionPane.INFORMATION_MESSAGE);
 		} catch (Exception e) {
 			JOptionPane.showMessageDialog(this, "错误。", e.getMessage(), JOptionPane.INFORMATION_MESSAGE);
 		}
-		//
-		updateApplicationXml(map);
-		// 根据dataSourceConfigs修改各个服务器中applicationContext.xml里面的数据
-		stringBuilder.append("xxx的配置,");
-		// 可以参考XmlConfigPathService中的方法
-		stringBuilder.append("请重新启动本程序。");
-		// 如果您修改了配置,请重新启动本程序
-		JOptionPane.showMessageDialog(this, stringBuilder.toString(), "提示:重新启动", JOptionPane.INFORMATION_MESSAGE);
 
 		
 	}
@@ -409,12 +408,12 @@ public class DataSourceSettingFrame extends JFrame {
 			try {
 				deleteApplicationXml(dataSourceConfig);
 				deleteYml(dataSourceConfig);
+				tableModel.removeRow(selectedRow);
+				// 执行删除的业务逻辑
+			    JOptionPane.showMessageDialog(null, "删除成功");
 			} catch (Exception e) {
 				JOptionPane.showMessageDialog(this, "错误。", e.getMessage(), JOptionPane.INFORMATION_MESSAGE);
 			}
-			tableModel.removeRow(selectedRow);
-			// 执行删除的业务逻辑
-		    JOptionPane.showMessageDialog(null, "删除成功");
 		}
 			
 	}