|
Difficult to reproduce, hence explaining the issue in detail here, Consider 5 concurrent threads using the same EntityManager (injected using @PersistenceContext) All 5 threads execute native queries(targeted towards the same tables) mapping the result to an Object (marked with @Entity) The Object implements the equals and hashCode only with the id property(marked with @Id) There are chances that the queries may fetch the same objects concurrently I was getting an NPE at TwoPhaseLoad.doInitializeEntity:167 as (final Object[] hydratedState = entityEntry.getLoadedState() hydratedState is null at this point
|