Skip to content

Commit

Permalink
[misc] ensure client prepare statement lock when closing bulk
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Oct 10, 2022
1 parent dc66cac commit fe6498b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/org/mariadb/jdbc/ClientPreparedStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,12 @@ public long[] executeLargeBatch() throws SQLException {
@Override
public void close() throws SQLException {
if (prepareResult != null) {
prepareResult.close(this.con.getClient());
lock.lock();
try {
prepareResult.close(this.con.getClient());
} finally {
lock.unlock();
}
}
con.fireStatementClosed(this);
super.close();
Expand Down

0 comments on commit fe6498b

Please sign in to comment.