1

私は NHibernate.Caches.Velocity を使用して Nhibernate の第 2 レベルのキャッシュを実装しようとしています。このブログ投稿を使用してスタック オーバーフローについてここで説明しました。

アプリケーションは Nhibernate 3.2 を使用した Azure WebRole です。

セッション ファクトリの初期化時にスローされる例外を除いて、すべてが正しいようです。

"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

Web.Config:

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

誰がこれを引き起こしているのか手がかりを持っていますか? ググっても、関連する結果は得られません。

4

1 に答える 1

0

NHibernate がキャッシュを使用しようとする方法に精通していないため、確かなことは言えませんが、Azure キャッシュはオンプレミス キャッシュのすべての機能をサポートしているわけではありません。サポートされていない機能を利用しようとしていると思います。MSには、2つの違いのリストがあります

于 2012-03-23T04:12:50.700 に答える