NHibernate的ASP.NET + +打开会话视图中的+ L2CACHE [英] NHibernate + ASP.NET + Open Session in View + L2Cache
问题描述
我使用$ C $的CProject的知名在View
打开会话来处理NHibernate的会议。它是否与 2级高速缓存
行之有效?任何人都已经成功做什么呢?我应该使用 NH.Burrow
呢?在asp.net的最佳实践的L2高速缓存的任何建议是AP preciated。
I am using CodeProject's well known Open Session in View
to handle NHibernate Sessions. Does it works well with Level 2 Cache
? Anyone has succeeded doing it? Should I use NH.Burrow
instead? Any advice on l2 cache in asp.net best practices is appreciated.
编辑:链接$ C $的CProject的文章: HTTP:// WWW 。codeproject.com / KB /建筑/ NHibernateBestPractices.aspx
link to CodeProject's article: http://www.codeproject.com/KB/architecture/NHibernateBestPractices.aspx
推荐答案
我用工作模式的单位来处理我的会议。然后,我创建一个实现会话每个Web请求一生的作品真的很好一个HttpModule。我的HttpModule请求启动工作单元的preExecuteRequestHandler钩,然后将其存储。然后,它使用的PostExecuteRequestHandler钩来完成组的工作。
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.
这是文章我的工作单位是基于:
的http://nhforge.org/wikis/patternsandpractices/nhibernate-and-the-unit-of-work-pattern.aspx
This is the article my Unit of Work is based on: http://nhforge.org/wikis/patternsandpractices/nhibernate-and-the-unit-of-work-pattern.aspx
这篇关于NHibernate的ASP.NET + +打开会话视图中的+ L2CACHE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!