private void addEntryToBatch(final TaskContext taskContext,
                                 final List<SQLStatValSourceDO> batchInsert,
                                 final SQLStatValSourceDO insert,
                                 final int batchSize) {
        batchInsert.add(insert);
        counter++;
        if (batchInsert.size() >= batchSize) {
            doSaveBatch(taskContext, batchInsert);
        }
    }
We can't drop out if interrupted as that would mean losing data.
We need to flush it all the DB before we can return.
stroom-statistics/stroom-statistics-impl-sql/src/main/java/stroom/statistics/impl/sql/SQLStatisticFlushTaskHandler.java