You should read/google/learn more about how nh is using proxies. http://nhforge.org/doc/nh/en/index.html#performance-fetching-initialization
Also, try read/google/learn more about session management in asp.net scenarios. NHibernate Burrow has some typical implementations about this and can be a good start. http://nhforge.org/media/p/9.aspx -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Smsgo Sent: den 15 juni 2009 14:48 To: nhusers Subject: [nhusers] Re: Initialize foreign obejcts I'm executing the code inside this using block: using (ISession session = OpenSession()) { IList<MyObject> objs= session.CreateCriteria(typeof (MyObject)).List<MyObject>(); } If I call objs[0].FooBar.Name inside of the using block or remove the using block it works. Is it ok to remove the using block while running in a ASP.NET env? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
