我正在尝试将对象存储到缓存中,例如:
Dictionary<Guid, Decimal> cacheSubscribers =
client.Get<Dictionary<Guid, Decimal>>("ListAllSubscribers");
if (cacheSubscribers == null)
{
cacheSubscribers = db.JK_Subscribers
.Where(x => x.sync)
.Select(x => new { x.guid, x.subscriber_id })
.ToDictionary(x => x.guid, x => x.subscriber_id);
if (!client.Store(StoreMode.Set, "ListAllSubscribers", cacheSubscribers, ts))
MessageBox.Show("Could not store ListAllSubscribers");
}
而且我总是得到client.Store
,false
并且它不会添加到服务器中。
在这个语句下面的几行我也有:
IEnumerable<JK_ChallengeAnswers> challengeAnswers = client.Get<IEnumerable<JK_ChallengeAnswers>>("ListAllChallengeAnswers");
if (challengeAnswers == null)
{
challengeAnswers = db.JK_ChallengeAnswers.Include("JK_Challenges").ToList();
client.Store(StoreMode.Set, "ListAllChallengeAnswers", challengeAnswers, ts);
}
这总是会添加到内存中...
有没有办法得到我不能存储对象的原因?
Dictionary
有大约95.000 条记录,并且在我的配置中
<socketPool minPoolSize="10"
maxPoolSize="100"
connectionTimeout="00:01:00"
deadTimeout="00:02:00" />
PS我正在使用Couchbaselocalhost