Hello
I have a gui tree and want to handle Drag&Drop handling in one transaction.
Drag an TreeNode on to another TreeNode should do the following on the server; remove the dragging TreeNode from it's parent and add it to the new parent.
Well this always results in the same exception:
org.hibernate.ObjectDeletedException: deleted entity passed to persist:
Here my code:
Code:
EntityManager em = getEntityManager();
em.getTransaction().begin();
parent.getChilds().remove(child);
target.getChilds().add(child);
em.persist(parent);
em.persist(target);
em.persist(child);
em.getTransaction().commit();
em.close();
Is this not possible in one transaction?
Appreciate any hint/help.
flavio