[
https://hibernate.onjira.com/browse/HHH-7113?page=com.atlassian.jira.plug...
]
Guenther Demetz commented on HHH-7113:
--------------------------------------
For the moment there's following workaouround:
persistentobject.naturalId="3"; // call following 2 lines after naturalId
modification
PersistenceContext persistentContext = (PersistenceContext)
session.getPersistenceContext();
persistentContext.loadedStateDeletedNotification(persistentContext.getEntry(persistentobject));
// these 2 lines above must be called before the flush occurs
NaturalIdLoadAccess not properly working on mutable NaturalId's
---------------------------------------------------------------
Key: HHH-7113
URL:
https://hibernate.onjira.com/browse/HHH-7113
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
Labels: naturalId
Attachments: TestCaseModifieableNaturalId.jar
Original Estimate: 16h
Remaining Estimate: 16h
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
See attached testcase:
On deletions the internal NaturalId cache is synchronized properly (testDeleteNaturalId)
but not on modifications (testModifieableNaturalId)
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira