if you're using lazy loading then you will need to attach the user back to a session so the properties can be loaded.
I would recommend not storing the user in session and load it from session each time. You can implement 2nd level cache for rapid loading and bypassing the whole issue altogether. On May 27, 10:06 pm, Craig van Nieuwkerk <[email protected]> wrote: > In my system when the user logs on I store the User entity into a > global session variable so it can be accessed from anywhere in the > system. The problem is that the User has several lazy load > relationships so when I try and access some of the properties of the > User I get the exception in the subject. Now doing some research it > appears I should be able to call NHibernateUtil.Initialize(user) > before populating the session variable and it will 'fill out' the user > object, unfortunately this seems to have no effect. Is there anything > I can do to fix this? > > Craig. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
