WCF RIA 服务和会话外的持久/静态变量
我想知道一旦客户端会话在 WCF RIA 服务中结束,是否有一种方法可以在业务层中保留变量。挑战是我们将加载相当数量的数据到缓存中,但希望缓存持续存在,并允许 silverlight 客户端连接到缓存,而无需重新创建它并重新加载所有数据。
有什么想法或解决方法吗?
谢谢你, 德里克
I am wondering if there is a way to persist variables in the business layer once the clients session has ended in WCF RIA Services. The challange is we are going to be loading a fair amount of data into caching but want the cache to persist, and allow the silverlight client to connect to the cache without recreating it and reloading all the data.
Any ideas or work arounds?
Thank you,
Derrick
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设该服务托管在 IIS 上。您可以在 Web 服务中设置 ASPNET 兼容性,然后可以使用应用程序和会话变量。
在 Web.config 中设置:
请参阅:http://social.msdn.microsoft.com/forums/en-US/wcf/thread/71671241-eab0-4b9f-9343-6e4445ed41a5 和 http://msdn.microsoft.com/en-us/library/ms733040.aspx
I presume the service is hosted on IIS. You can set the ASPNET compatibility on in a web service and then can use Application and Session variables.
Set this in Web.config:
<serviceHostingEnvironment aspNetCompatibilityEnabled=”true” />
See: http://social.msdn.microsoft.com/forums/en-US/wcf/thread/71671241-eab0-4b9f-9343-6e4445ed41a5 and http://msdn.microsoft.com/en-us/library/ms733040.aspx