We're updating the issue view to help you get more done. 

Inline natural-id synchronization doesn't consider reattached objects

Description

Inline natural-id synch process relies on all entity objects in persistence context having it's according natural-id values cached in the NaturalIdResolutionCache.
While we assured that for the 'persist','update' and 'load from datasource' scenarios, we forgot about reattachements where the object get not load again from datasource, these are: session.update(object) and session.lock(object,LockMode.None).
The problem rises when detaching objects and then re-attaching them to a new session.
See pull-requests for solution proposal and according testcases.

Environment

None

Status

Assignee

Steve Ebersole

Reporter

Guenther Demetz

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

4.1.2

Priority

Major