Skip to content

Commit

Permalink
fix dead lock in multi DB when using batchUpdate(#31038)
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Jason committed May 12, 2024
1 parent 12144de commit 7622e69
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
import java.sql.SQLException;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;

/**
* Abstract execution prepare engine.
Expand Down Expand Up @@ -80,7 +80,7 @@ private List<List<ExecutionUnit>> group(final List<ExecutionUnit> sqlUnits) {
protected abstract List<ExecutionGroup<T>> group(String dataSourceName, int connectionOffset, List<List<ExecutionUnit>> executionUnitGroups, ConnectionMode connectionMode) throws SQLException;

private Map<String, List<ExecutionUnit>> aggregateExecutionUnitGroups(final Collection<ExecutionUnit> executionUnits) {
Map<String, List<ExecutionUnit>> result = new LinkedHashMap<>(executionUnits.size(), 1F);
Map<String, List<ExecutionUnit>> result = new TreeMap<>();
for (ExecutionUnit each : executionUnits) {
result.computeIfAbsent(each.getDataSourceName(), unused -> new LinkedList<>()).add(each);
}
Expand Down

0 comments on commit 7622e69

Please sign in to comment.