We have the following hierarchy in the business model:
A has an association with B and C.
In the database:
B holds the FK of A and C holds the FK of A.
We are facing a problem when the operation should result in the DELETE of the entire hierarchy.
This problem occurs ONLY AT TIMES AND NOT ALWAYS.
Probelm Defn:
The delete method is being called on the OBJECTS in the following order:
1. C
2. B
3. A
However, at times, the order in which hibernate fires the delete queries differs from the order mentioned above.
Hence, that resutls in the following error:
org.hibernate.exception.ConstraintViolationException: could not delete:[]
Could there be a problem in the order in which Hibernate exceutes the queries.
|