On Wed, Sep 29, 2010 at 4:53 PM, Matt Schmidt <mschmid...@gmail.com> wrote:

> I am using LoadableDetachableModel's to load my persisted objects from the
> database, but I am still getting a lazy load exception when accessing a
> property that is a Set.
>
> For example: take persistent POJO Product that has this property, where
> ProductType is another persistent POJO:
>
> private Set<ProductType> productTypes;
>
>
> I get the lazy load when trying to access this property from the LDM:
>
> Collection<ProductType> x = ((Product)
> model.getObject()).getProductTypes();
>
> for(ProductType pt : x) {     //lazy load here
>
> .....
>
>
> What am I missing?
>

Well, it's impossible for us to tell you.  You are obviously making this
call in LDM#load() after your transaction manager has closed the Hibernate
session.  What are you using to do transaction / session management, etc?

-- 
Jeremy Thomerson
http://www.wickettraining.com

Reply via email to