JPA N+1 problem

Content:

Original link: What is N+1 Problem with Spring Boot and How to Solve it? / Medium.

It is a common problem with ORM's. Anyone wanting to use an ORM should know how to avoid it for that specific ORM. Some do - some don't. Always worth repeating.

Note that the article is JPA specific so it does not apply to EntityFramework etc.. Despite the original title then it is not Spring Boot related - the problem is exactly the same whether it is a Java SE application, a web application hosted in Tomcat or a web application self hosted via Spring Boot.

Comments: