Use commitIfBatch when we don't need to commit each time
Use commitIfBatch when we don't need to commit each time