I'm trying to delete a parent with childs but can't do it...
I have the cascade="all-delete-orphan"...
the problem is when it try to delete one child it first set the parentID to null.. and then try to delete it... but i get a stale exception (i'm using version timestamp), i know why i'm getting the exception.. i just can't understand why it try to set the parentID to null... just in case.. I CAN'T USE BIDIRECTIONAL RELATIONSHIPS...
(monthlyTransaction is the child and fund is the parent)
Quote:
03:19:20,400 INFO [STDOUT] Hibernate: update monthlyTransaction set fundId=null where fundId=?
03:19:20,403 INFO [STDOUT] Hibernate: delete from monthlyTransaction where id=? and timestamp=?
03:19:20,406 WARN [StaleObjectStateException] An operation failed due to stale data
net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) for uy.edu.ort.domain.classes.MonthlyTransaction instance with identifier: 1