Detecting transient state of mandatory toOne relations is broken

Description

The attached test-case shows that we get an TransientPropertyValueException when saving an entity, even though the referenced entity is clearly persisted before and should not be regarded as transient.
The bug seems to be introduced by and is closely related to that issue.

The new issues seems to appear when one entity is cached but the referenced entity is not (causing different DelayedPostInsertIdentifier handling for the two entities).

Environment

Spring-Boot 2.1, Java 8, Windows 10, H2DB

Activity

Show:
Chris Cranford
December 18, 2018, 4:51 AM

We're going to revert and all related fixes since to restore legacy behavior. We'll reapproach the changes needed for another way.

Gail Badner
December 20, 2018, 8:06 AM

, this will need to be addressed in 5.3 branch as well. Please let me know exactly which issues need to be backported.

Chris Cranford
January 8, 2019, 2:30 AM

, would it help if I just create a PR for 5.3 with all the necessary backports for you and let you review that? It wouldn't take very long for me to put that together if that would be much easier for you.

Chris Cranford
January 11, 2019, 6:34 AM
Gail Badner
February 19, 2019, 5:18 PM

Fixed in 5.3 branch as well.

Fixed

Assignee

Chris Cranford

Reporter

Florian Kirchmeir

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.3.6

Components

Affects versions

Priority

Critical