Skip to content

Commit

Permalink
0002192: Conflict resolution of FALLBACK transforms update to insert …
Browse files Browse the repository at this point in the history
…although row exists
  • Loading branch information
chenson42 committed Feb 12, 2015
1 parent 16a2460 commit c94acaf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ public boolean start(Table table) {

public void write(CsvData data) {
context.remove(AbstractDatabaseWriter.CONFLICT_ERROR);
write(data, false);
}

protected void write(CsvData data, boolean fallback) {
/* If the startTable has been called and the targetTable is required then check
* to see if the writer has been configured to ignore this data event
*/
Expand Down Expand Up @@ -175,7 +171,7 @@ protected void write(CsvData data, boolean fallback) {
}

if (loadStatus == LoadStatus.CONFLICT) {
if (conflictResolver != null && !fallback) {
if (conflictResolver != null) {
conflictResolver.needsResolved(this, data, loadStatus);
} else {
throw new ConflictException(data, targetTable, false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected void performFallbackToInsert(AbstractDatabaseWriter writer, CsvData da
}

writer.start(table);
writer.write(newData, true);
super.performFallbackToInsert(writer, newData, conflict, retransform);
writer.end(table);
}

Expand Down Expand Up @@ -102,7 +102,7 @@ protected void performFallbackToUpdate(AbstractDatabaseWriter writer, CsvData da
if (newlyTransformedData.hasSameKeyValues(transformedData.getKeyValues())) {
Table table = newlyTransformedData.buildTargetTable();
writer.start(table);
writer.write(newlyTransformedData.buildTargetCsvData(), true);
super.performFallbackToUpdate(writer, newlyTransformedData.buildTargetCsvData(), conflict, retransform);
writer.end(table);
}
}
Expand Down

0 comments on commit c94acaf

Please sign in to comment.