This content has been marked as final.
Show 3 replies
-
1. Re: Simple remove wont work. Detached instance
alexg79 Jan 12, 2007 7:36 AM (in response to trashhash)Are you by any chance using "service" through a remote interface?
Why do you need to cast the result to User btw? Does that method return other objects than Users? -
2. Re: Simple remove wont work. Detached instance
trashhash Jan 12, 2007 2:06 PM (in response to trashhash)Thansk for your reply. It turns out that the exception is thrown because the cascade option. This works fine.
em.remove(em.merg(user));
Whileem.remove(user);
Dose not work because my User have an external reference to a Address. So bt deleting User it would like to also delete The Address.
Now I would like to know who do I set the cascade option. So I can delete a Player without removing a Team. And vice versa.
Thanks for your time. -
3. Re: Simple remove wont work. Detached instance
trashhash Jan 12, 2007 2:35 PM (in response to trashhash)Sorry for reposting, but Im not able to edit my post.
To answer your question, yes Im using my service through remote interface. And casting is overflow, its always returning a user.
I have look a bit more into CASCADE but Im only finding option for enable, not disable. So default should be disable? Why cant I cant I remove a simple Entity with no external reference?