Skip to content

Commit

Permalink
Close statement first, then the connection
Browse files Browse the repository at this point in the history
  • Loading branch information
wendigo committed Nov 8, 2024
1 parent 2d4c746 commit 934460d
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ public CompletableFuture<Collection<Slice>> finish()
public void abort()
{
// rollback and close
try (Connection connection = this.connection;
PreparedStatement statement = this.statement) {
try (PreparedStatement statement = this.statement; Connection connection = this.connection) {
// skip rollback if implicitly closed due to an error
if (!connection.isClosed()) {
connection.rollback();
Expand Down

0 comments on commit 934460d

Please sign in to comment.