title: Saving JPA entity twice
body: <p>I am trying to save one JPA entity twice as I want to store parent and revisions of my articles.</p>
  
  <p>When I create new Article, I actually want to create parent and a revision which is a duplicate of the parent. Something like:</p>
  
  <pre><code>Article parent = new Article();
  Article revision = parent.clone();
  
  em.persist(parent);
  em.persist(revision);
  </code></pre>
  
  <p>But what actually happens is that I am getting following exception on the second call of persist:</p>
  
  <pre><code>org.hibernate.StaleStateException: 
       Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
  </code></pre>
  
  <p>How can I clone the Article so that I won't get such exceptions?</p>