NHibernate + ASP.NET +在视图中打开会话 +二级缓存

发布于 2024-08-20 20:47:25 字数 398 浏览 3 评论 0原文

我正在使用 CodeProject 著名的 Open Session in View 来处理 NHibernate 会话。它与二级缓存配合得很好吗?有人成功做过吗?我应该使用 NH.Burrow 来代替吗?任何有关 ASP.NET 最佳实践中的二级缓存的建议都值得赞赏。

编辑:链接到 CodeProject 的文章: http://www.codeproject.com/KB/architecture /NHibernateBestPractices.aspx

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.

Edit: link to CodeProject's article: http://www.codeproject.com/KB/architecture/NHibernateBestPractices.aspx

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夜还是长夜 2024-08-27 20:47:25

我使用工作单元模式来处理我的会话。然后我创建了一个 HttpModule,它实现了“每个 Web 请求的会话”生命周期,效果非常好。我的 HttpModule 在 PreExecuteRequestHandler 挂钩上启动一个工作单元,然后将其存储在请求中。然后它使用 PostExecuteRequestHandler 挂钩来完成工作单元。

这是我的工作单元所基于的文章:
http://nhforge.org/wikis/patternsandpractices /nhibernate-and-the-unit-of-work-pattern.aspx

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

烂柯人 2024-08-27 20:47:25

至于 NHibernate L2 缓存,请查看这篇文章,

NCache 作为 L2 缓存。

NCache 是.NET 和Java 的企业级分布式缓存,还为ASP.NET 和JSP 会话提供快速可靠的存储。 NCache 还提供用于 Nhibernate 二级缓存的插件。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文