progress.start();
try {
select.scroll(row -> callSingleHandler(handler, updates.iterator().next(), row));
- closeUpdates();
+ closeStatements();
// log the total number of processed rows
progress.log();
progress.start();
try {
select.scroll(row -> callMultiHandler(handler, updates, row));
- closeUpdates();
+ closeStatements();
// log the total number of processed rows
progress.log();
counter.getAndIncrement();
}
- private void closeUpdates() throws SQLException {
+ private void closeStatements() throws SQLException {
for (UpsertImpl update : updates) {
if (update.getBatchCount() > 0L) {
update.execute().commit();
}
update.close();
}
+ select.close();
}
}