Quote:
Is lazy="false" what you are looking for?
Its close, setting the lazy=false for class works. If I set lazy=false on the collections then the whole object graph will get eagerly loaded which I dont want.
What I do now is set default-lazy=false for each file, which means all classes get eagerly loaded. Then I set lazy=true explicitly on collections. In my dal I connect the session query the objects and any children. Then I close/disconnect the session and recursivley remove all the proxies.
I do all this by injecting code into NHibernate types so it runs pretty quick. However, its still a lot of overhead.
My intention is to get everything working as it is (using my hack above). Hopefully, when I get further along in the project I can get into some the NHibernate code and create a config file option that basically does all this for me.
If I dont get to this then obviously its not enough overhead to make it worth doing ;)