Alex CD (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiODc3NTIxYzcw...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-14058?atlOrigin=eyJpIjoiODc3NT...
) HHH-14058 (
https://hibernate.atlassian.net/browse/HHH-14058?atlOrigin=eyJpIjoiODc3NT...
) Second level cache missing entity after delete child with foreign key on delete set null
(
https://hibernate.atlassian.net/browse/HHH-14058?atlOrigin=eyJpIjoiODc3NT...
)
Change By: Alex CD (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
*Person* entity references one *Nickname* entity having foreign key *on delete set null*.
If _Person entity is stored in second level cache and her Nickname_ entity is deleted by a
native query, then the reference id is set to null in database, but the cached _Person_
entity still has the old reference id.
Loading the _Person_ from second level cache (entitymanager.find) tries to load the old
_Nickname_ that doesn't exist, throws _EntityNotFoundException_ that cascades and
ultimately returns a *null Person* object.
Person _Person_ entity still *exists* in database and should have been found and the
invalid reference should be resolved somehow (maybe recheck in database).
(
https://hibernate.atlassian.net/browse/HHH-14058#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-14058#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#100128- sha1:03ebdb2 )