My problems are resolved! MyBatis now runs at the same time as querying directly to the database.
This was an N + 1 issue (nicely described here ).
Decision
Nested results (as opposed to Nested selection ), which is also described on the same page as mentioned above.
The difference he made with my four-join SQL query was huge:
I tracked the problem by splitting it into a JUnit test file around MyBatis-Spring (removing the JBoss part).
source share