gpt4 book ai didi

c# - 如何解决Azure中NHibernate缓存的 "This operation is not supported by the cache."问题?

转载 作者:行者123 更新时间:2023-12-03 04:39:29 24 4
gpt4 key购买 nike

我正在尝试使用 NHibernate.Caches.Velocity 实现 Nhibernate 二级缓存并讨论 here on stack overflow使用这个this blog post .

该应用程序是使用 Nhibernate 3.2 的 Azure WebRole。

除了初始化 session 工厂时抛出的异常之外,一切似乎都是正确的:

"This operation is not supported by the cache."

堆栈跟踪:

at Microsoft.ApplicationServer.Caching.DataCacheFactory.ThrowNotSupportedException()
at Microsoft.ApplicationServer.Caching.DataCacheFactory.CreateHybridClient(String cacheName, NamedCacheConfiguration config, SimpleSendReceiveModule sendRcvModule)
at Microsoft.ApplicationServer.Caching.DataCacheFactory.CreateNewCacheClient(DataCacheDeploymentMode mode, String cacheName, NamedCacheConfiguration config, SimpleSendReceiveModule sendRcvModule)
at Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName)
at NHibernate.Caches.AppFabric.AppFabricCacheFactory.GetCache(String cacheName, Boolean useDefault)
at NHibernate.Caches.AppFabric.AppFabricCacheAdapter..ctor(String regionName)
at NHibernate.Caches.AppFabric.Adapters.AppFabricCacheNamedAdapter..ctor(String regionName)
at NHibernate.Caches.AppFabric.AppFabricCacheAdapterFactory.Create(String regionName)
at NHibernate.Caches.AppFabric.AppFabricProvider.BuildCache(String regionName, IDictionary`2 properties)
at NHibernate.Cache.UpdateTimestampsCache..ctor(Settings settings, IDictionary`2 props)
at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings, EventListeners listeners)
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs:line 230

网络配置:

  <dataCacheClients>
<dataCacheClient name="default">
<hosts>
<host name="xxx.cache.windows.net" cachePort="22233" />
</hosts>
<securityProperties mode="Message">
<messageSecurity
authorizationInfo="xxx">
</messageSecurity>
</securityProperties>
</dataCacheClient>
</dataCacheClients>

有谁知道这是什么原因造成的吗?如果我用谷歌搜索,我得到的相关结果为零。

最佳答案

我不能肯定地说,因为我不熟悉 NHibernate 尝试使用缓存的方式,但 Azure 缓存不支持本地缓存的所有功能。我猜想它正在尝试利用不受支持的功能。 MS有一个list of the differences between the two

关于c# - 如何解决Azure中NHibernate缓存的 "This operation is not supported by the cache."问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9830844/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com