Hi, Andrea, I figured out the reason why the 4th query is different between our test cases. I have the property hibernate.max_fetch_depth set to 1 in the SessionFactory of my environment and that property is not set in the SessionFactory of your test class. If you add this line to your settings then you will see the extra queries:
Now the question is: If there is no row in the AGENCY_DETAIL table for the agency, there are as many extra SELECT FROM AGENCY_DETAIL queries as the number of rows in the GROUP_USER table. However, If there is one row in the AGENCY_DETAIL table for the agency, then there is NO extra SELECT FROM AGENCY_DETAIL query. Do you have any insight why that’s the case? |