u are receiving this exception since remove, as defined by the spec (persistence 3.1.1), throws illegalargumentexceptions for detached entities. If you want to remove the entity that way, u first have to reintegrate the entity instance in the persistence context using merge.
regards, milan wölke
Thanks for your post....However, the problem is i am NOT receiving this exception when I am indeed expecting it. My sentence was not too clear.. it should read
"According to the EJB spec [section] 3.2.2 3rd option should this not result in a IllegalArgumentException? [exception]"
Environment is jboss-4.0.4RC1
In Jboss 4.0.4.CR2: if you do it in the way of ejb3 spec final draft you would get an exception :). NonUniqueObjectException. You can remove only detached objects.