Hibernate 3.3.1.GA (JPA 1.0) +
EJB 3.0
Hi everyone,
I know that invoking merge() on a detached object should be just fine. Even if you explicitly invoke detach() operation to detach an object after the merge() operation and modify it is just fine. However it doesn't work on related entities if you explicitly invoke detach() operation on them and modify. And that's what I want to understand why. It throws "org.hibernate.PersistentObjectException: detached entity passed to persist"
Here's an example:
Could anyone enlighten me on this? AFAIK, merge should work on detached objects but seeing the result, it seems to me that it's not the merge() operation that is being cascaded on the related entities but the persist() operation.
Thanks!