Lazy loaded properties of bytecode enhanced entity are left stale after refresh of entity

Description

A bytecode enhanced entity with lazy loaded properties (@Basic or @Formula or @OneToMany) yields the stale values for the properties when accessing them after calling entityManager.refresh on the entity.

I found this in version 5.4.2 while migrating an app from 3.6.0. This was not a problem in 3.6.0. From debugging, it appears the problem was introduced by a change to PojoEntityTuplizer in revision 1e44e74. The
LazyAttributeLoadingInterceptor for the entity still retains its list of initalizedLazyFields after the entity is refreshed.

Test case is attached. If you'd rather have me submit a pull request with the test case added to a fork of the project, let me know.

Environment

None

Attachments

Assignee

Unassigned

Reporter

Jay Paulsen

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

3.6.0

Components

Affects versions

Priority

Major
Configure