title: Doctrine - A new entity was found through the relationship
body: <p>since 2 weeks, we are having this problem while trying to flush new elements:</p>
  
  <blockquote>
    <p>CRITICAL: Doctrine\ORM\ORMInvalidArgumentException:</p>
    
    <p>A new entity was found through the relationship 'Comment#capture' that was not configured to cascade persist operations for entity</p>
  </blockquote>
  
  <p>But the <code>capture</code> is already in the database, and we are getting it by a <code>findOneBy</code>, so if we cascade persist it, or persist it, we get a</p>
  
  <blockquote>
    <p>Table constraint violation: duplicate entry.</p>
  </blockquote>
  
  <p>The comments are created in a loop with differents captures, with a new, and all required field are set.</p>
  
  <p>With all of the entities persisted and / or got by a <code>findOne</code> (and all valid), the flush still fails.</p>
  
  <p>I'm on this issue since a while, so please help me</p>