richardantal commented on code in PR #1729:
URL: https://github.com/apache/phoenix/pull/1729#discussion_r1392575597
##########
phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixConnection.java:
##########
@@ -720,17 +717,17 @@ public void clearWarnings() throws SQLException {
}
private void closeStatements() throws SQLException {
- List<? extends PhoenixStatement> statements = this.statements;
- // create new list to prevent close of statements
- // from modifying this list.
- this.statements = Lists.newArrayList();
try {
mutationState.rollback();
} catch (SQLException e) {
// ignore any exceptions while rolling back
} finally {
try {
- SQLCloseables.closeAll(statements);
+ // create new list to prevent close of statements from
modifying this collection.
+ // TODO This could be optimized out by decoupling closing the
stmt and removing it
+ // from the connection.
+ List<? extends PhoenixStatement> statementsCopy = new
ArrayList<>(this.statements);
Review Comment:
Is there a reason why the statements got changed to HashSet?
This copy is a list and it is not consistent this way.
--
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]