title: JPA Best practice for managing entities in extended Persistence Context
body: <p>I am using CDI conversation scoped, Seam managed extended persistence context (PC). This provides more fine-grained control over PC and avoids LIEs. I am using CDI Beans instead of EJB Beans. In a page, I retrieve list of entities and show them in a table. The selected entity record from the table is binded to the form and can be edited but not persisted until the "save" button is clicked. In this place the problem occurs, since all entities are managed the edited entities are also persisted when I try to flush/commit only one current entity in save action. What is the preferred best-practice approach to this kind of problems. Should I use middle POJO between the managed entity and the viewed/edited one? Should I detach then merge (before saving) the current in-progress entity? Any suggestions?  </p>
  
  <p>JPA 2.0, Hibernate 4.x<br>
  Seam 3 (Weld CDI, persistence, transaction, faces modules)<br>
  JSF 2.1<br>
  Java EE 6.</p>