Lazy loaded OneToMany gets initialized on refresh

Description

Having an entity with more than one @OneToMany associations with cascade = CascadeType.ALL, if I invoke session.refresh() on that entity, one (and only one) of these associations gets loaded.

Example, with this model:

When doing:

Not only invoice is refreshed from DB, but also its lines, although taxes do not.

I’d expect not to have initialized any of its associations, but in any case not just one of them (1st one?).

Here a test case to reproduce it.

Forum discussion

Environment

None

Assignee

Guillaume Smet

Reporter

Asier Lostalé

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure