I finally got this lazy session setup to work: http://nhforge.org/blogs/nhibernate/archive/2011/03/03/effective-nhibernate-session-management-for-web-apps.aspx
Other than the default session, I want to create a StatelessSession that is for read-only or that doesn't keep track of changes.
So for some queries in my repository I will choose the default, and f开发者_如何学运维or others I can choose to use the StatelessSession.
You can try to define two session for two different database user, the first user has full grant on data object, the second user has only read (select) grant on database object.
精彩评论