jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Lombart" <christophe.lomb...@gmail.com>
Subject Re: OCM - Help with lazy loading using proxy=true
Date Thu, 27 Mar 2008 21:57:19 GMT
On Thu, Mar 27, 2008 at 9:25 PM, sgomez <sage.es@gmail.com> wrote:
>  Hi everyone.
>  I'm trying to lazy load a collection mapped with the attribute proxy=true
>  but it doesn't seem to work. Maybe I haven't understood the concept of lazy
>  loading in this context, because I've read it waits until the getter method
>  is called to retrieve the collection, but I can't find any sense in that.
>  I'd quote where I read it from but I can't find it right now and I'm in a
>  bit of a hurry. I'll follow up with the quote when I find it if someone
>  finds it appropriate.
>  The doubts that have rose since I tried using the lazy load are: What will
>  you get when calling ocm.getObject(path) on a path pointing to an object
>  with lazy loading collections? Will you get the object with it lists being
>  null?
no, a proxy is created and assign to the list. If you debug, you see it.

>How do you test if the collections have been really lazy loaded if by
>  calling the getter you make the collections be fetched from the repository?

we are using cglib. So, it is not difficult to implement. When a
method call is made on the collection attribute, the collection is
retrieved. See the java classes in

Hope this help. Let me know if you need more info.


View raw message