Steps to reproduce:
* Entity hierarchy: ** Entity A <<has a>> Embeddable B ** Embeddable B <<has many, cascade=all-delete-orphan>> Entity C * Persist an instance of A with an instance of B and non-empty collection of C * *Do NOT flush the session* * Query for A with HQL query
Result:
{noformat}org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: org.hibernate.bugs.hhh16117.model.Parent.data.children{noformat}
Workaround: Explicitly flush() after persist()
Reproducer: [https://github.com/cwatzl/HHH-16117|https://github.com/cwatzl/HHH-16117]
Similar symptoms to [HHH-15512|https://hibernate.atlassian.net/browse/HHH-15512], but seems to be related to Embeddables.
May also possibly be related to [ Detailed description & reproducer coming within the hour HHH-15864|https://hibernate.atlassian.net/browse/HHH-15864 ] . |
|