Github user MikeThomsen commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2447#discussion_r165860112
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/QueryDatabaseTable.java
 ---
    @@ -315,6 +334,12 @@ public void onTrigger(final ProcessContext context, 
final ProcessSessionFactory
     
                             
session.getProvenanceReporter().receive(fileToProcess, jdbcURL, 
stopWatch.getElapsed(TimeUnit.MILLISECONDS));
                             resultSetFlowFiles.add(fileToProcess);
    +                        // If we've reached the batch size, send out the 
flow files
    +                        if (outputBatchSize > 0 && 
resultSetFlowFiles.size() >= outputBatchSize) {
    +                            session.transfer(resultSetFlowFiles, 
REL_SUCCESS);
    +                            session.commit();
    +                            resultSetFlowFiles.clear();
    --- End diff --
    
    I usually reinitialize the collection in cases like this. I think in the 
past I've had weird behavior from a collection when using clear() a lot on a 
lot of referenced objects. Not a needed change and maybe that's paranoia on my 
part based on weirdness from past projects.


---

Reply via email to