From 2d23c95c3fe3644fcee569724c65bb695adc31d1 Mon Sep 17 00:00:00 2001
From: Justin <thekeyboardbum@gmail.com>
Date: Wed, 30 Jul 2014 15:00:35 -0700
Subject: [PATCH] Fix bulk insert code example

Previous code example did not flush all entities when entity count was not a multiple of batch count.
---
 docs/en/reference/batch-processing.rst | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/docs/en/reference/batch-processing.rst b/docs/en/reference/batch-processing.rst
index 77b4e1720..7a62aff00 100644
--- a/docs/en/reference/batch-processing.rst
+++ b/docs/en/reference/batch-processing.rst
@@ -42,6 +42,8 @@ internally but also mean more work during ``flush``.
             $em->clear(); // Detaches all objects from Doctrine!
         }
     }
+    $em->flush(); //Persist objects that did not make up an entire batch
+    $em->clear();
 
 Bulk Updates
 ------------