Christoph Watzl (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYWQ1MDdlNzE2...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16117?atlOrigin=eyJpIjoiYWQ1MD...
) HHH-16117 (
https://hibernate.atlassian.net/browse/HHH-16117?atlOrigin=eyJpIjoiYWQ1MD...
) Querying entity with collection in Embeddable causes 'A collection with
cascade="all-delete-orphan" was no longer referenced by the owning entity
instance' (
https://hibernate.atlassian.net/browse/HHH-16117?atlOrigin=eyJpIjoiYWQ1MD...
)
Change By: Christoph Watzl (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Steps to reproduce:
* Create 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
[
HHH-15864|https://hibernate.atlassian.net/browse/HHH-15864].
(
https://hibernate.atlassian.net/browse/HHH-16117#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16117#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100214- sha1:d3cc1a2 )