title: Doctrine 2 update data into Database but not update data into Entity
body: <p>Working on zend framework 2 with doctrine 2.</p>
  
  <p>While unit testing, I use a 'testing database' to add, edit and delete values from.</p>
  
  <p>The issue was that I add a new entity, ok.
  After I add the new entity, witch works perfecty, i tried to Update the entity.</p>
  
  <pre><code>//set all values
  $this-&gt;getEntityManager-&gt;persist($dataEntity);
  $this-&gt;getEntityManager-&gt;flush()
  </code></pre>
  
  <p>When I Try to retrieve the updated data using:</p>
  
  <pre><code>    $produtoAcessorioCompareEntity = $this-&gt;getEntityManager()-&gt;getRepository('Administrador\Entity\ProdutoAcessorio')-&gt;findOneBy(array(
          'idProdutoAcessorio' =&gt; $produtoAcessorioEntity-&gt;getIdProdutoAcessorio()
      ));
  </code></pre>
  
  <p>But this cached the old data from ADD Method and not updated the data for the new Entity $produtoAcessorioCompareEntity, I got the old values.</p>
  
  <p>When I check the database, the new values are there. So should have one trick to reorganize loaded entities that I'm probably missing.</p>
  
  <p>How can I update the Working Entities After Persist and Flush, to get the new values by $this->getEntityManager->getRepository() instead open a new connection?</p>