NHibernate + ASP.NET + Open Session in View + L2Cache

杀马特。学长 韩版系。学妹 提交于 2019-12-04 12:28:30

I use the Unit of Work pattern to handle my session. Then I create an HttpModule that implements a "Session Per Web Request" lifetime that works really well. My HttpModule starts a Unit of Work on the PreExecuteRequestHandler hook, then stores it in the request. Then it uses the PostExecuteRequestHandler hook to complete the Unit Of Work.

This is the article my Unit of Work is based on: http://nhforge.org/wikis/patternsandpractices/nhibernate-and-the-unit-of-work-pattern.aspx

AS Far as NHibernate L2 cache is concerned, please check this read,

NCache as L2 cache.

NCache is an enterprise level distributed cache for .NET and Java and also provides a fast and reliable storage for ASP.NET and JSP Sessions. NCache also offers its plug-in for Nhibernate secondary level caching.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!