title: OnFlush not working Symfony2 ODM
body: <p>Hi I want to create Logs who did what in my Bundle. So I am using OnFlush Event of Symfony2. and created a Listener for this. but it is not triggered.</p>
  
  <p><strong>//My Listener</strong></p>
  
  <pre><code>namespace Edu\AccountBundle\EventListener;
  use Doctrine\ODM\MongoDB\DocumentManager;
  use Symfony\Component\EventDispatcher\EventDispatcherInterface;
  use Symfony\Bundle\FrameworkBundle\Routing\Router;
  use Edu\AccountBundle\CommonFunctions\CommonFunctions;
  use Edu\AccountBundle\Constants\allConstants;
  use Symfony\Component\HttpFoundation\Session\Session;
  use Doctrine\Common\EventSubscriber;
  use Doctrine\ODM\Event\OnFlushEventArgs;
  
  class OnFlushListener
  {
      private $session;
      private $router;
      private $commonFunctions;
      private $constants;
  
      public function __construct(Session $session, Router $router, DocumentManager $dm)
      {
          $this-&gt;session = $session;
          $this-&gt;router = $router;
          $this-&gt;dm = $dm;
          $this-&gt;commonFunctions  = new CommonFunctions();
          $this-&gt;constants        = new allConstants();
      }
  
      public function onFlush(OnFlushEventArgs $event)
      {
          echo "come here after Saving data";die;
      }
  } 
  </code></pre>
  
  <p><strong>//config.xml</strong></p>
  
  <pre><code>&lt;service id="edu.account.event.listener" class="Edu\AccountBundle\EventListener\OnFlushListener"&gt;
      &lt;argument type="service" id="session"/&gt;
      &lt;argument type="service" id="router"/&gt;
      &lt;argument type="service" id="doctrine_mongodb.odm.document_manager"/&gt;
      &lt;tag name="doctrine.event_listener" event = "onFlush" method="onFlush"/&gt;
  &lt;/service&gt;
  </code></pre>
  
  <p>While I am trying to save any document it is not get called. the "onFlush" method. Please guide what i am missing in this.</p>
  
  <p>Thanks Advance</p>