Remove then Query fails in JPA/Hibernate (deleted entity passed to persist)
- by Kevin
I've got a problem with the removal of entities in my JPA application: basically, I do in this EJB Business method:
load photo list ;
for each photo {
//UPDATE
remove TagPhoto element from @OneToMany relation
//DISPLAY
create query involving TagPhoto
...
}
and this last query always throws an EntityNotFoundException (deleted entity passed to persist: [...TagPhoto#])
I think I understand the meaning of this exception, like a synchronization problem caused by my Remove, but how can I get rid of it?