Source:
private void startGeneratorThread(String lastSourceOffset) throws StageException, SQLException { Offset offset = null; LocalDateTime startTimestamp; startLogMnrForRedoDict(); if (!StringUtils.isEmpty(lastSourceOffset)) { offset = new Offset(lastSourceOffset); if (lastSourceOffset.startsWith("v3")) { if (!useLocalBuffering) { throw new StageException(JDBC_82); } startTimestamp = offset.timestamp.minusSeconds(configBean.txnWindow); } else { if (useLocalBuffering) { throw new StageException(JDBC_83); } startTimestamp = getDateForSCN(new BigDecimal(offset.scn)); offset.timestamp = startTimestamp; } adjustStartTimeAndStartLogMnr(startTimestamp); } else { if (configBean.startValue != StartValues.SCN) { LocalDateTime startDate; if (configBean.startValue == StartValues.DATE) { startDate = LocalDateTime.parse(configBean.startDate, dateTimeColumnHandler.dateFormatter); } else { startDate = nowAtDBTz(); } startDate = adjustStartTimeAndStartLogMnr(startDate); offset = new Offset(version, startDate, ZERO, 0); } else { BigDecimal startCommitSCN = new BigDecimal(configBean.startSCN); startLogMnrSCNToDate.setBigDecimal(1, startCommitSCN); final LocalDateTime start = getDateForSCN(startCommitSCN); LocalDateTime endTime = getEndTimeForStartTime(start); startLogMnrSCNToDate.setString(2, endTime.format(dateTimeColumnHandler.dateFormatter)); startLogMnrSCNToDate.execute(); offset = new Offset(version, start, startCommitSCN.toPlainString(), 0); } } final Offset os = offset; final PreparedStatement select = selectFromLogMnrContents; generationExecutor.submit(() -> { try { generateRecords(os, select); } catch (Throwable ex) { LOG.error("Error while producing records", ex); generationStarted = false; } }); }

Target:
private void startGeneratorThread(String lastSourceOffset) throws StageException, SQLException { Offset offset = null; LocalDateTime startTimestamp; try { startLogMnrForRedoDict(); if (!StringUtils.isEmpty(lastSourceOffset)) { offset = new Offset(lastSourceOffset); if (lastSourceOffset.startsWith("v3")) { if (!useLocalBuffering) { throw new StageException(JDBC_82); } startTimestamp = offset.timestamp.minusSeconds(configBean.txnWindow); } else { if (useLocalBuffering) { throw new StageException(JDBC_83); } startTimestamp = getDateForSCN(new BigDecimal(offset.scn)); offset.timestamp = startTimestamp; } adjustStartTimeAndStartLogMnr(startTimestamp); } else { if (configBean.startValue != StartValues.SCN) { LocalDateTime startDate; if (configBean.startValue == StartValues.DATE) { startDate = LocalDateTime.parse(configBean.startDate, dateTimeColumnHandler.dateFormatter); } else { startDate = nowAtDBTz(); } startDate = adjustStartTimeAndStartLogMnr(startDate); offset = new Offset(version, startDate, ZERO, 0); } else { BigDecimal startCommitSCN = new BigDecimal(configBean.startSCN); startLogMnrSCNToDate.setBigDecimal(1, startCommitSCN); final LocalDateTime start = getDateForSCN(startCommitSCN); LocalDateTime endTime = getEndTimeForStartTime(start); startLogMnrSCNToDate.setString(2, endTime.format(dateTimeColumnHandler.dateFormatter)); startLogMnrSCNToDate.execute(); offset = new Offset(version, start, startCommitSCN.toPlainString(), 0); } } } catch (SQLException ex) { if(ex.getErrorCode() == MISSING_LOG_FILE || ex.getErrorCode() == NO_LOG_FOUND) { throw ex; } LOG.error("SQLException while trying to setup record generator thread", ex); generationStarted = false; return; } final Offset os = offset; final PreparedStatement select = selectFromLogMnrContents; generationExecutor.submit(() -> { try { generateRecords(os, select); } catch (Throwable ex) { LOG.error("Error while producing records", ex); generationStarted = false; } }); }