@EntityGraph annotation log warning message "Entity graph specified is not applicable to the entity ... . Ignored." and works as if EntityGraph.EntityGraphType.LOAD would set.

Description

After update to hibernate 4.5.20 with a new spring-boot 2.3.3 my application start to flood logs with a warning
"Entity graph specified is not applicable to the entity [entity type]. Ignored."
and a lot of N+1 query issues appeared while report generation.

@EntityGraph annotation starts to log this error on each entity retrieving. and start to work as if EntityGraph.EntityGraphType.LOAD would set. so it fetches a lot eagerly fetched relationships (in my case it is crucial as I have quite a complex data model and retrieve few thousands of entities ).

Here is a git repo that has only 4 entities and reproduces the issue.
https://github.com/ikarfall/hibernate-entity-graph-bug
Run the test to see warning in logs end extra queries.
here is the diff of console output between 4.5.18 and 4.5.20

Environment

None

Activity

Show:
Nathan Xu
September 10, 2020, 2:57 AM
Edited

PR created at

Andrei Ivanov
September 22, 2020, 7:55 AM
Edited

Will this get into 5.4.x too? Since it’s a regression, I hope it will

Andrei Ivanov
2 days ago

Nathan?

Nathan Xu
2 days ago

I am hoping as well. I left a comment in the PR to urge back porting (among many other guys). Fingers crossed.

Sanne Grinovero
yesterday

It was backported, releasing soon! Many thanks and

Assignee

Nathan Xu

Reporter

Yaroslav Prokipchyn

Fix versions

Labels

None

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.4.18

Components

Affects versions

Priority

Major
Configure