EntityNotFoundException « Update « JPA Q&A





1. javax.persistence.EntityNotFoundException    forum.hibernate.org

Hi, I have a OneToMay relationship in my project, and when I try to remove the side that holds the collection this exception arise: javax.persistence.EntityNotFoundException: deleted entity passed to persist: [org.desoft.dcp.ag.entity.Block#] at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:598) at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:513) at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:101) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:269) This is my code: The first class has this code for the relation: @OneToMany(mappedBy="block",fetch=FetchType.EAGER,cascade=CascadeType.ALL) public Set getFields() { return fields; } And ...

2. EntityNotFoundException when merge    forum.hibernate.org

@Test public final void testAddingTravelWithMember(){ TravelRequest travelRequest = new TravelRequest(); RequestMember requestMember = new RequestMember(); requestMember.setTravelRequest(travelRequest); requestMember.setMember(member); travelRequest.getRequestMembers().add(requestMember); member.getRequestMembers().add(requestMember); ...

3. EntityNotFoundException merging new graph    forum.hibernate.org

I am trying to persist a graph of objects that are laid out as follows: A have a Tree (T) object that owns a collection of Nodes (N). Each node has a collection of child nodes and a reference to a parent node (these are non-containment relationships) forming an hierarchy of nodes. I basically want to load T and in one ...