Browse Source

Pull request #10815: REPORT-85774 sqlserver死锁

Merge in DESIGN/design from ~ABEL.CHEN/design:release/11.0 to release/11.0

* commit 'd60c0c7a958df3b66410f8920e37ed0c018f9393':
  REPORT-85774 sqlserver死锁
release/11.0
abel.chen-陈亮 2 years ago
parent
commit
a5de167edf
  1. 13
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

13
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -209,7 +209,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
* @return * @return
*/ */
private boolean needUpdate0(Connection origin, Connection connection) { private boolean needUpdate0(Connection origin, Connection connection) {
return !connection.equals(origin) || !isEmbedConnection(connection); return !connection.equals(origin) || !isEmbedConnection(connection);
} }
/** /**
@ -257,12 +257,21 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
} }
private boolean saveByOldWay(List<String> removedConnNames, List<ConnectionBean> addedOrUpdatedConnections) { private boolean saveByOldWay(List<String> removedConnNames, List<ConnectionBean> addedOrUpdatedConnections) {
final int remaining = ConnectionConfig.getInstance().getRemainingCon(removedConnNames.size(), addedOrUpdatedConnections.size());
try { try {
return Configurations.modify(new WorkerFacade(ConnectionConfig.class) { return Configurations.modify(new WorkerFacade(ConnectionConfig.class) {
@Override @Override
public void run() { public void run() {
removedConnNames.forEach(n -> ConnectionConfig.getInstance().removeConnection(n)); removedConnNames.forEach(n -> ConnectionConfig.getInstance().removeConnection(n));
addedOrUpdatedConnections.forEach(cb -> ConnectionConfig.getInstance().addConnection(cb.getName(), cb.getConnection())); int innerRemaining = remaining;
for (ConnectionBean cb : addedOrUpdatedConnections) {
if (innerRemaining > 0) {
ConnectionConfig.getInstance().addConnectionWithoutCheck(cb.getName(), cb.getConnection());
innerRemaining--;
} else {
break;
}
}
} }
}); });
} catch (Exception e) { } catch (Exception e) {

Loading…
Cancel
Save