Skip to content

Commit

Permalink
fixed the problem when using Bulk Api and turning on the 'Config.PROC…
Browse files Browse the repository at this point in the history
…ESS_BULK_CACHE_DATA_FROM_DAO' configuration
  • Loading branch information
mcgrinberg committed Feb 2, 2024
1 parent 8261225 commit ffd6d52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ private void processBatchResults(final BatchInfo batch, final String errorMessag
for (final Row row : rows) {
boolean conversionSuccessOfRow = isRowConversionSuccessful(skippedRowsCount
+ this.firstDAORowForCurrentBatch + dataReaderRowCount++);
if (!conversionSuccessOfRow) {
if (!conversionSuccessOfRow && !controller.getConfig().getBoolean(Config.PROCESS_BULK_CACHE_DATA_FROM_DAO)) {
continue; // this DAO row failed to convert and was not part of the batch sent to the server. Go to the next one
}
final List<String> res = resultRdr.nextRecord();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,23 @@ public boolean visit(Row row) throws OperationException, DataAccessObjectExcepti
}
dynaArray.add(dynaBean);
this.batchRowToDAORowList.add(this.processedDAORowCounter);
this.processedDAORowCounter++;
} catch (ConversionException | IllegalAccessException conve) {
String errMsg = Messages.getMessage("Visitor", "conversionErrorMsg", conve.getMessage());
getLogger().error(errMsg, conve);

conversionFailed(row, errMsg);
// this row cannot be added since conversion has failed
if (!controller.getConfig().getBoolean(Config.PROCESS_BULK_CACHE_DATA_FROM_DAO)) {
this.processedDAORowCounter++;
}
return false;
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
this.processedDAORowCounter++;
}

// load the batch
Expand Down

0 comments on commit ffd6d52

Please sign in to comment.