[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-7133) NaturalIdLoadAccess not correctly working on mutable NaturalId's
Steve Ebersole (JIRA)
noreply at atlassian.com
Wed Mar 14 18:04:48 EDT 2012
[ https://hibernate.onjira.com/browse/HHH-7133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45955#comment-45955 ]
Steve Ebersole commented on HHH-7133:
-------------------------------------
I could never reproduce the delete case (your testSubclassDeleteNaturalId test). Granted I did not use your test case as is. I tried to reproduce it using just APIs.
I was able to reproduce the issue of different persisters being passed into {{NaturalIdXrefDelegate}} and then being used there as keys into the map of {{NaturalIdResolutionCache}}. That is now working.
> NaturalIdLoadAccess not correctly working on mutable NaturalId's
> ----------------------------------------------------------------
>
> Key: HHH-7133
> URL: https://hibernate.onjira.com/browse/HHH-7133
> Project: Hibernate ORM
> Issue Type: Bug
> Components: core
> Affects Versions: 4.1.0
> Environment: Hibernate4.1.0, db independent (HSQLDB used in attached testcase)
> Reporter: Guenther Demetz
> Assignee: Steve Ebersole
> Labels: Modifieable, NaturalId
> Fix For: 4.1.2
>
> Attachments: TestCaseModifieableNaturalId.jar
>
> Original Estimate: 16h
> Remaining Estimate: 16h
>
> 1. After updating the value of a mutable NaturalId, the entity object can be retrieved with the new value, but also with the old value.
> assertNotSame(session.bySimpleNaturalId(C.class).load("1"), session.bySimpleNaturalId(C.class).load("3")); --> failing
> Cause: On deletions the internal NaturalId cache get synchronized properly, but not on modifications (no synchronization provided at all)
> 2. When inserting or deleting an entity object, the entity-persister of the object's concrete class is considered as cache-region.
> When loading an entity object by NaturalId, indeed the entity-persister of the declaring class is considered as cache-region.
> Session.byNaturalId(declaringclass).load(...)
> As declaringclass may be the superclass of a concrete subclass,
> the NaturalId-synchronisation (currently called only on deletions) does synchronize the wrong cache-region.
> (it tries to remove the entry in the cache-region of the subclass-persister,
> but the entry is actually cached in the cache-region of the superclass persister)
> N.B: This issue has nothing to do with spreading @NaturalId across an entity hierarchy (HHH-7129),
> in attached testcase the NaturalId is declared exclusively in the root class.
> Attached testcase demonstrates both bugs.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list