Remove then Query fails in JPA/Hibernate (deleted entity passed to persist)

Posted by Kevin on Stack Overflow See other posts from Stack Overflow or by Kevin
Published on 2010-05-30T10:36:30Z Indexed on 2010/05/30 10:42 UTC
Read the original article Hit count: 262

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about java

Related posts about hibernate