Skip to content

Commit

Permalink
fix: handling exceptions when multi AZ isDialect() function fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Paiva Lima da Silva committed Dec 21, 2023
1 parent dd2c4bc commit 02f08cf
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,15 @@ public class RdsMultiAzDbClusterMysqlDialect extends MysqlDialect {

@Override
public boolean isDialect(final Connection connection) {
try (final Statement stmt = connection.createStatement();
final ResultSet rs = stmt.executeQuery(TOPOLOGY_QUERY)) {
return rs.next();
} catch (final SQLException ex) {
try {
try (final Statement stmt = connection.createStatement();
final ResultSet rs = stmt.executeQuery(TOPOLOGY_QUERY)) {
return rs.next();
} catch (final SQLException ex) {
// ignore
}
return false;
} catch (Exception ex) {
// ignore
}
return false;
Expand Down

0 comments on commit 02f08cf

Please sign in to comment.