DBZ-1446 Use error code instead of exception message; elevate log message level

This commit is contained in:
Jiri Pechanec 2020-11-11 10:12:40 +01:00
parent 76e27c8c26
commit 02fd590119

View File

@ -187,10 +187,10 @@ private Optional<Long> getLatestTableDdlScn(RelationalSnapshotContext ctx) throw
return Optional.of(rs.getLong(1)); return Optional.of(rs.getLong(1));
} }
catch (SQLException e) { catch (SQLException e) {
if (e.getMessage().startsWith("ORA-08180")) { if (e.getErrorCode() == 8180) {
// DBZ-1446 In this use case we actually do not want to propagate the exception but // DBZ-1446 In this use case we actually do not want to propagate the exception but
// rather return an empty optional value allowing the current SCN to take prior. // rather return an empty optional value allowing the current SCN to take prior.
LOGGER.debug("No latest table SCN could be resolved, defaulting to current SCN"); LOGGER.info("No latest table SCN could be resolved, defaulting to current SCN");
return Optional.empty(); return Optional.empty();
} }
throw e; throw e;