AFAIY it is part of the cached query. If I debug it and look at the
Owner property, it is not proxied.  Plus, I did a quick test by
retrieving the Owner property in the code-behind whenever I move from
one page to the other in my DataList, and the Owner is NOT fetched
from the database, it is fetched from the cache.

The Owner is only retrieved from the database if I do the Eval thing
in the html page.

I don't think that's meant to be like that. Do you have any idea what
it could be ?

On 13 oct, 19:20, Fabio Maulo <fabioma...@gmail.com> wrote:
> what should do NH if the Owner is not part of the cached query ?
>
> 2009/10/13 graphicsxp <graphic...@googlemail.com>
>
>
>
>
>
> > Hi,
>
> > I'm binding a DataList control in ASP.net to an IList of Video
> > entities returned by a NH query. The DataList is paginated and if I
> > move from one page to the other, NH gets the data from the 2nd level
> > cache because I've cached the query.
>
> > The entities in my IList look like this :
>
> > Video {Id, Title, Owner}
> > Owner{Id, User}
>
> > I do Eager fetching on Owner when I get my list of Video entities.
> > I've checked when debugging and the Video entities contain their
> > respective Owner entity.
>
> > However if my DataList template I do :
>
> > <label text='<%# Eval("Owner.FullName") %>' />
>
> > Then the Owner is not retrieved from the cache and instead NH does a
> > separate query for each Video entity (at least one per distinct
> > owner).
>
> > Why ?  Is that a bug in the ASP.net Caching or is it to do with NH ?
>
> --
> Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to