NHibernate 二级缓存
我正在开发一个 Windows 客户端-服务器应用程序。服务器作为 Windows 服务运行,所有客户端都通过 WCF 连接到它。服务器使用 NHibernate 3 进行数据访问。我现在希望为 NHibernate 启用二级缓存。现在我正在寻找应该使用哪个 CacheProvider。有人可以给我一个关于这个的提示吗?也许有安装/配置教程的链接? 谢谢。
最好的问候,托马斯
I am developing a Windows Client-Server application. The Server is running as a Windows Service and all Clients connect to it with WCF. The Server uses NHibernate 3 for DataAccess. I am now looking to enable 2nd Level Caching for NHibernate. Now I am looking which CacheProvider I should use for this. Can somebody give me a tip about this? Perhaps with a link to a tutorial for installation/configuration?
Thank you.
Best Regards, Thomas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果服务器是单实例,则 SysCache2 实现已做好生产准备。它建立在 ASP.NET 缓存之上,并提供出色的性能。
如果您正在运行多个服务器实例,您将需要一个分布式缓存管理器,并且您将需要更仔细地规划您的缓存策略。可以使用 AppFabric 缓存(以前称为 Velocity)。我们目前正在自行评估这一问题,并发现了一些我们仍在努力解决的问题。或者还有一些商业产品,例如 NCache 可能值得一看,因为好吧,虽然我不确定它是否适用于 NH3。
If the server is single instance the SysCache2 implementation is production ready. This is built on the ASP.NET cache and provides excellent performance.
If you are running multiple server instances you will need a distributed cache manager and you will need to plan your caching strategies much more carefully. The AppFabric Cache (formerly Velocity) can be used. We are currently evaluating this one ourselves and have found a number of issues we are still trying to resolve. Alternately there are commercial offerings such as NCache which may be worth looking at as well though I'm not sure if it's available for NH3 yet.
回应 Phil 提到的有关 Ncache 的内容。它已为 NH3 做好准备,只需进行最少的代码更改即可开始将其用作 Nhibernate 的 L2 缓存。它可以免费下载,您可以在此处阅读有关将其用作 L2 缓存的信息:
http://www.alachisoft.com/ncache/nhibernate-l2cache-index.html
In response to what Phil has mentioned about Ncache. It is NH3 ready and provides for minimal code changes to start using it as an L2 cache for Nhibernate. It is available for free download and you can read about using it as an L2 cache here:
http://www.alachisoft.com/ncache/nhibernate-l2cache-index.html