title: Concurrent modification exception when save
body: <p>When I save a list of added elements I get a concurrent modification exception. Below is the code of the save method called:</p>
  
  <pre><code>listAta listata = em.findbyid(id);
  for (adressata ad : getInstance().getList()) {
      em.merge(ad);
  }
  em.merge(listata);
  em.flush();
  </code></pre>
  
  <p>The line that caused the exception is <code>for (adressata ad : getInstance().getList())</code></p>
  
  <p>Below is the entity data:</p>
  
  <pre><code>@ManyToOne((fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
  @JoinColumn(name="id_list" , nullable=false)
  private ListAta listAta;
  </code></pre>
  
  <p>How is this caused and how can I solve it?</p>