linghengqian commented on issue #34418:
URL:
https://github.com/apache/shardingsphere/issues/34418#issuecomment-2613852772
- Just in case someone doesn't know `try-catch` is java syntax. It's hard to
tell what there is to do here.
```java
private List<Connection> createConnections(final String databaseName, final
String dataSourceName, final DataSource dataSource, final int connectionSize,
final
TransactionConnectionContext transactionConnectionContext) throws SQLException {
List<Connection> result = new ArrayList<>(connectionSize);
for (int i = 0; i < connectionSize; i++) {
try {
Connection connection = createConnection(databaseName,
dataSourceName, dataSource, transactionConnectionContext);
result.add(connection);
} catch (final SQLException ex) {
for (Connection each : result) {
each.close();
}
throw new
OverallConnectionNotEnoughException(connectionSize, result.size(),
ex).toSQLException();
}
}
return result;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]