Jira issue originally created by user @beberlei:
This issue is created automatically through a Github pull request on behalf of acasademont:
If you have only $batchSize - 1 rows (amongst other cases), the entities are never flushed, you need a final flush outside the loop.
In the bulk insert you should also need a final flush if the number of entities inserted is not a multiple of the $batchSize.
Comment created by @beberlei:
A related Github Pull-Request [GH-576] was closed
Issue was closed with resolution "Fixed"