Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Lazy loading can operate when persistence context is closed?



fcalfo wrote:
> 
> Doesn't the persistence context have to be open for a lazy loaded
> collection to be fetched?
> 
> I am making sure to run the static weaver
> (org.eclipse.persistence.tools.weaving.jpa.StaticWeave) before running my
> test.
> 
> 


More info on this: while inspecting the Contract.class file after the static
weaver was applied, it looks like
it didn't weave in the lazy loading.

Here's the class definition from the class file after StaticWeave was run:

public class jpa.Contract implements java.lang.Cloneable,
org.eclipse.persistence.internal.weaving.PersistenceWeaved,
org.eclipse.persistence.internal.descriptors.PersistenceEntity,
org.eclipse.persistence.internal.descriptors.PersistenceObject {

It did something since it added the PersistenceWeaved interface

but it should have also added the PersistenceWeavedLazy interface.

Why didn't it add that even though I added the lazy fetch type on the
supplierContracts collection and the eclipselink.weaving.lazy property is
set to true?

(I do have this working on another class so I'm wondering what I'm missing
here)
-- 
View this message in context: http://www.nabble.com/Lazy-loading-can-operate-when-persistence-context-is-closed--tp23990687p23990831.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top