Unexpected TransientPropertyValueException with enhancement as proxy

Description

Using bytecode enhancement with lazy initialization and enhancement as proxy (allow_enhancement_as_proxy set to true), an update on 1 field of an entity, followed by reading some associations of this entity fails with:
TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing

Without enhancement as proxy, everything works as usual with a single update statement for the modified field, and subsequent select for lazy associations.

Enhancement as proxy is promising, but using it in production leads to very weird issues, that are hard to reproduce in a simple test case.
Perhaps you're already aware of that kind of issues and I guess it's not recommended to use enhancement as proxy in production (neither bytecode enhancement with lazy initialization).

Environment

None

Activity

Show:
Andrea Boriero
January 13, 2021, 4:02 PM

Hi ,

can you please provide a test? I tried to reproduce the issue but without any luck.

Thanks

Patrice Blanchardie
January 14, 2021, 8:37 AM

Hi, thanks for trying. I also ran out of time trying to reproduce it with a simple model, and will try again as soon as possible with a reproducer based on the real model.

Andrea Boriero
January 14, 2021, 9:39 AM

Thanks a lot!

Assignee

Unassigned

Reporter

Patrice Blanchardie

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure