Is there Linq to Nhibernate for stateless session?
I was using regular session for loading some items from database via linq. The problem is that it caches the entities and memory load increases very much unnecessarily. Is there a way to replace sess开发者_StackOverflow社区ion with stateless session without introducing many changes in client code?
Linq support for stateless session is included in version 3.1.0 See the release notes: https://nhibernate.jira.com/browse/NH-2211
It's not possible to use Linq with IStatelessSession.
You can use all the other query methods (Get, Criteria, HQL and SQL).
Update (2010-07-19): I believe Steve might be adding this to the NH 3.x provider)
Have you got lazy loading turned on?
I don't have any experience with LINQ to NHibernate, but in my application, lazy loading makes a huge difference in performance.
精彩评论