You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The upgrade to Hibernate 6.2 causes its proxy generation strategy to differ depending on execution context. We previously used a lazy many-to-one relationship to verify our proxy identifier logic as that relationship reliably resulted in a proxy instance being created on versions < 6.2. It looks like some optimizations in Hibernate [0] now cause it "optimize" the proxy away. I wasn't able to figure out the exact circumstances of that optimization but our tests running on CI reliably didn't see a proxy returned while local, standalone executions did.
We now simply obtain a proxy through EntityManager.getReference(…) and verify that the identifier is still accessible, dropping the addition check for a non-initialization.
[0] https://hibernate.atlassian.net/browse/HHH-15790
Related ticket: #2899.
Copy file name to clipboardExpand all lines: spring-data-jpa/src/test/java/org/springframework/data/jpa/mapping/JpaMetamodelMappingContextIntegrationTests.java
0 commit comments