If your load is happening on subsequent page refreshes, then that is the
correct behaviour for an NHibernate web session, where the session only
exists for a single page view. If you are not having any performance
concerns do not try to perform unnecessary optimization, if you are having
performance problems then you need to investigate caching strategies that
span page views.

John Davidson

On Fri, Apr 9, 2010 at 8:23 AM, Quintin Par <[email protected]> wrote:

> Hi,
>
> In my web application the master pagedoes authentication and loads up the
> user entity using a Get.
>
> After this whenever the user object is needed by the usercontrols or any
> other class I do a Load.
>
> Normally nhibernate is supposed to load the object from cache or return
> the persistent loaded object
> <http://ayende.com/Blog/archive/2009/04/30/nhibernate-ndash-the-difference-between-get-load-and-querying-by.aspx>
> whenever Load of called. But this is not the behavior shown by my web
> application. *NHprof* always shows the sql whenever Load is called. How do
> I verify the correct behavior of Load?
>
> -Quintin
>
> P.S. *Cross posted at 
> stackoverflow<http://stackoverflow.com/questions/2575270/load-vs-get-in-nhibernate>4
>  days ago
> *
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to