我可以在负载平衡服务器中使用 Microsoft 企业库缓存吗?我的情况是我有一个位于 2 个负载平衡服务器中的 Web 服务,并且我使用具有如下配置的数据库缓存“backingStores”
<cachingConfiguration defaultCacheManager="Cache Manager">
<cacheManagers>
<add name="Cache Manager" type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="MyDataCacheStorage11"/>
</cacheManagers>
<backingStores>
<add name="MyDataCacheStorage11" type="Microsoft.Practices.EnterpriseLibrary.Caching.Database.DataBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching.Database, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" encryptionProviderName="" databaseInstanceName="EntLib1ConnectionString111" partitionName="CAPwiki Cache"/>
<add type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="NullBackingStore"/>
</backingStores>
</cachingConfiguration>
当我从 server1 使用键“ _testorderstatus3 ”设置缓存并尝试从 server2 获取它时,它返回 Null 值!
同样,当我从 server1 使用相同的键设置值并从 server2 再次设置时,我检查了数据库,我发现它设置了 2 次,如下所示
有什么想法吗?我需要设置并进入两台服务器。
谢谢