JPA + EclipseLink - Lazy Loading with closed EntityManager
问题 I'm using EclipseLink as JPA provider in a Java SE project. I have properly configured the weaving to allow the Lazy Loading. Unlike Hibernate (which throws LazyInitializationException), EclipseLink can get a proxy of LAZY relationship, even with a closed EntityManager. To run this query, it gets a new connection from the pool. Is there some setting that disables or changes the behavior of this feature? I need to get a null value or an exception when trying to access an unloaded attribute,