DBZ-137 Added todos and a try-with-resource blocks

This commit is contained in:
Chris Cranford 2020-08-25 11:01:51 -04:00 committed by Gunnar Morling
parent d4b0143cdd
commit d7c3f04a07
2 changed files with 6 additions and 7 deletions

View File

@ -172,14 +172,12 @@ static Set<String> getCurrentRedoLogFiles(Connection connection, LogMinerMetrics
String checkQuery = SqlUtils.CURRENT_REDO_LOG_NAME;
Set<String> fileNames = new HashSet<>();
PreparedStatement st = connection.prepareStatement(checkQuery);
ResultSet result = st.executeQuery();
try(PreparedStatement st = connection.prepareStatement(checkQuery); ResultSet result = st.executeQuery()) {
while (result.next()) {
fileNames.add(result.getString(1));
LOGGER.trace(" Current Redo log fileName: {} ", fileNames);
}
st.close();
result.close();
}
updateRedoLogMetrics(connection, metrics, fileNames);
return fileNames;

View File

@ -130,6 +130,7 @@ public void execute(ChangeEventSourceContext context) {
}
// 1. Configure Log Miner to mine online redo logs
// todo: DBZ-137 this step can actually be executed outside the loop at start-up.
setNlsSessionParameters(jdbcConnection);
checkSupplementalLogging(jdbcConnection, connectorConfig.getPdbName());