int outCount = 0;
try (BatchTransaction tx = new BatchTransaction(getServer().getDb(),config.getBatchSize(),reporter)) {
while ((input = reader.readNext()) != null) {
Map<String, Object> queryParams = update(params, types, input);
String newQuery = applyReplacements(query, replacements, queryParams);
ExecutionResult result = getEngine().execute(newQuery, queryParams);
outCount += writeResult(result, writer, first);
first = false;
ProgressReporter.update(result.getQueryStatistics(), reporter);
tx.increment();
}
}
return outCount;
}