Skip to content

Commit

Permalink
0004038: Snapshot fails when batch in error
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Jul 10, 2019
1 parent feb1799 commit 62b5da9
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -258,7 +258,11 @@ public static File createSnapshot(ISymmetricEngine engine) {
extract(export, 10000, "order by start_id, end_id desc", new File(tmpDir, "sym_data_gap.csv"),
TableConstants.getTableName(tablePrefix, TableConstants.SYM_DATA_GAP));

outputSymDataForBatchesInError(engine, tmpDir);
try {
outputSymDataForBatchesInError(engine, tmpDir);
} catch (Exception e) {
log.warn("Failed to export data from batch in error", e);
}

extract(export, new File(tmpDir, "sym_table_reload_request.csv"),
TableConstants.getTableName(tablePrefix, TableConstants.SYM_TABLE_RELOAD_REQUEST));
Expand Down Expand Up @@ -816,11 +820,10 @@ public static void outputSymDataForBatchesInError(ISymmetricEngine engine, File

// Write parsed row data to file
String filenameParsed = tmpDir + File.separator + batch.getBatchId() + "_parsed.csv";
String[] columnNames = engine.getDatabasePlatform().getTableFromCache(data.getTableName(), false).getColumnNames();
CsvWriter writer = null;
try {
writer = new CsvWriter(filenameParsed);
writer.writeRecord(columnNames);
writer.writeRecord(data.getTriggerHistory().getParsedColumnNames());
writer.writeRecord(data.toParsedRowData());
writer.writeRecord(data.toParsedOldData());
} catch (IOException e) {
Expand Down

0 comments on commit 62b5da9

Please sign in to comment.