spring.net Could not initialize proxy - the owning Session was closed 解决

产生这个错误,是对象处于游离状态,或者对象本就没有被HibernateTemplate给实利化所导致的。在Web.config 添加以下代码可以解决此问题。

<httpModules>
      <add name="OpenSessionInView" type="Spring.Data.NHibernate.Support.OpenSessionInViewModule, Spring.Data.NHibernate12"/>
 </httpModules>

posted on 2009-07-01 19:05  ToKens  阅读(261)  评论(0编辑  收藏  举报