Skip to content

Commit

Permalink
Merge pull request #986 from ashitsalesforce/master
Browse files Browse the repository at this point in the history
Fix for W-14887469 and W-14893310
  • Loading branch information
ashitsalesforce authored Feb 15, 2024
2 parents 8a632e0 + ed7bda0 commit 391316f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.force</groupId>
<artifactId>dataloader</artifactId>
<packaging>jar</packaging>
<version>60.0.0</version>
<version>60.0.1</version>
<name>Salesforce Data Loader</name>
<url>https://github.com/forcedotcom/dataloader</url>
<organization>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
import com.salesforce.dataloader.exception.DataAccessObjectInitializationException;
import com.salesforce.dataloader.exception.LoadException;
import com.salesforce.dataloader.exception.OperationException;
import com.salesforce.dataloader.exception.ParameterLoadException;
import com.salesforce.dataloader.model.NACalendarValue;
import com.salesforce.dataloader.model.NADateOnlyCalendarValue;
import com.salesforce.dataloader.model.NATextValue;
Expand Down Expand Up @@ -542,17 +541,9 @@ private void processBatchResults(final BatchInfo batch, final String errorMessag
final int idIdx = hdrIndices.get(ID_RESULT_COL);
final int errIdx = hdrIndices.get(ERROR_RESULT_COL);
hdrIndices = null;
int dataReaderRowCount = 0;
int skippedRowsCount = 0;
try {
skippedRowsCount = controller.getConfig().getInt(Config.LOAD_ROW_TO_START_AT);
} catch (ParameterLoadException e) {
// @ignored
}

for (final Row row : rows) {
boolean conversionSuccessOfRow = isRowConversionSuccessful(skippedRowsCount
+ this.firstDAORowForCurrentBatch + dataReaderRowCount++);
boolean conversionSuccessOfRow = isRowConversionSuccessful();
if (!conversionSuccessOfRow) {
continue; // this DAO row failed to convert and was not part of the batch sent to the server. Go to the next one
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,20 @@ public void setRowConversionStatus(int dataSourceRow, boolean conversionSuccess)
}
}

protected boolean isRowConversionSuccessful(int dataSourceRow) {
Boolean conversionFailure = this.rowConversionFailureMap.get(dataSourceRow);
private int rowConversionCheckCounter = 0;
private boolean gotSkippedRowsCount = false;
private int skippedRowsCount = 0;
protected boolean isRowConversionSuccessful() {
if (!gotSkippedRowsCount) {
try {
skippedRowsCount = controller.getConfig().getInt(Config.LOAD_ROW_TO_START_AT);
gotSkippedRowsCount = true;
} catch (ParameterLoadException e) {
// @ignored
}
}
int rowToCheck = skippedRowsCount + rowConversionCheckCounter++;
Boolean conversionFailure = this.rowConversionFailureMap.get(rowToCheck);
if (conversionFailure != null && conversionFailure.booleanValue()) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,9 @@ private void writeOutputToWriter(Object[] results)
// have to do this because although saveResult and deleteResult
// are a) not the same class yet b) not subclassed
int batchRowCounter = 0;
int startAtDAORow = 0;
try {
startAtDAORow = controller.getConfig().getInt(Config.LOAD_ROW_TO_START_AT);
} catch (ParameterLoadException e) {
// @ignored
}
for (int i = 0; i < this.daoRowList.size(); i++) {
Row daoRow = this.daoRowList.get(i);
if (!isRowConversionSuccessful(startAtDAORow + i)) {
if (!isRowConversionSuccessful()) {
continue;
}
String statusMsg = null;
Expand Down

0 comments on commit 391316f

Please sign in to comment.