Skip to content

Commit

Permalink
[Hotfix][Connector][Jdbc] Fix reconnect throw close statement exception
Browse files Browse the repository at this point in the history
  • Loading branch information
hailin0 committed May 22, 2023
1 parent 7d61ae9 commit c9cbecc
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,14 @@ public synchronized void close() {
}

public void updateExecutor(boolean reconnect) throws SQLException, ClassNotFoundException {
jdbcStatementExecutor.closeStatements();
try {
jdbcStatementExecutor.closeStatements();
} catch (SQLException e) {
if (!reconnect) {
throw e;
}
LOG.info("Close JDBC statement failed on reconnect.", e);
}
jdbcStatementExecutor.prepareStatements(
reconnect
? connectionProvider.reestablishConnection()
Expand Down

0 comments on commit c9cbecc

Please sign in to comment.