Skip to content

Commit

Permalink
0003879: MSSQL Bulk loader creates excessive logging when max batch size
Browse files Browse the repository at this point in the history
for the load is greater than max rows to flush
  • Loading branch information
jumpmind-josh committed Feb 21, 2019
1 parent 7b86fdb commit 1a7356b
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -205,7 +205,8 @@ protected void bulkWrite(CsvData data) {

protected void flush() {
if (loadedRows > 0) {
this.stagedInputFile.close();
this.stagedInputFile.close();

statistics.get(batch).startTimer(DataWriterStatisticConstants.LOADMILLIS);
String filename;
if (StringUtils.isEmpty(uncPath)) {
Expand Down Expand Up @@ -240,11 +241,12 @@ protected void flush() {
//TODO: clean this up, deal with errors, etc.?
stmt.execute(sql);
stmt.close();

loadedRows = 0;
} catch (SQLException ex) {
throw getPlatform().getSqlTemplate().translate(ex);
} finally {
statistics.get(batch).stopTimer(DataWriterStatisticConstants.LOADMILLIS);
this.stagedInputFile.delete();
}
}
}
Expand Down

0 comments on commit 1a7356b

Please sign in to comment.