I'm using Hibernte 4.3.x.
If I try to remove(delete) a object from DB = EM.remove(entity) the object will keep in DB (remove not executed) if Hibernate find references in the managed objects in the Entity Manager Context. (to avoid data inconsistency I guess)
Is it possible with configuration/settings (I found nothing so far) that the transaction throws a exception that remove was not possible because of found references?
(this has nothing to do with cascading/remove)
edit: Example
EM.remove(ObjectA.getObjectB());
If the transaction is executed. All seams fine no exception is thrown. As a "beginner" I expect that the ObjectB is deleted. But it isn’t. It's still there. The EM "see" that there is still a reference from ObjectA to ObjectB and dosn't execute the delete.
If I say to the EM it should persist or remove something and that is not possible I want know this.
(I know with ObjectA.setObjectB(null) the example works)