Hi,
I am still posting about this issue since I am not able to define if it's a bug or a mistake.
I am planning to use EJB3 in a project in the near future, but probably I have to go back to EJB2.x.
MasterManager managerMaster = (MasterManager) myUtils.getBean("masterdetail.manager.interfaces.MasterManagerRemote"); Master master = managerMaster.find((Long) myForm.get("id")); UserTransaction ut = myUtils.getTransaction(); ut.begin(); List<masterdetail.entity.Detail> getDetails_Details = master.getDetails(); masterdetail.manager.interfaces.DetailManagerRemote managerDetail = (masterdetail.manager.interfaces.DetailManagerRemote) myUtils.getBean("masterdetail.manager.interfaces.DetailManagerRemote"); for (masterdetail.entity.Detail Detail : getDetails_Details) { Detail.setMaster(null); managerDetail.merge(Detail); } managerMaster.remove(master); if (ut.getStatus() == Status.STATUS_ACTIVE) ut.commit();
@Stateless public class MasterManagerBean implements MasterManagerRemote, MasterManagerLocal { @PersistenceContext private EntityManager manager; ...... public void remove(Master MasterVariable) { manager.remove(MasterVariable); } }
javax.ejb.EJBTransactionRolledbackException: null; CausedByException is: a different object with the same identifier value was already associated with the session: [masterdetail.entity.Master#21] at
....
....