2013-07-11 4 views
0

Я пишу код, чтобы удалить запись кэша из не-Azure AppFabric (v1.1). В фрагменте кода ниже, DataCache.Remove всегда возвращается ложь ...AppFabric: DataCache.Remove всегда сбой

object bogusData = new object(); 

_cache.Put(account, bogusData, TimeSpan.FromSeconds(10.0)); 
Sleep(1000); // for testing purposes 

// we don't need the contents of the cache entry, we just want to know 
// if the account is in the cache or not... 
object cachedData = _cache.Get(account); 

// if we don't find it in the cache, it is already been removed (or expired), so return true. 
if (cachedData == null) 
    return true; 

Sleep(1000); // for testing purposes 

// this always returns false 
bool status = _cache.Remove(account); 

Конструктивно, в приведенном выше фрагменте кода, cachedData всегда! = NULL.

Любые идеи?

ответ

0

Woot!

Я понял, вызывая DataCache.Remove (key) попытается удалить элемент из области по умолчанию. Хотя, не ясно показано выше (_cache - тонкая оболочка вокруг DataCache), наши вызовы Put/Get включают имя региона, но наш Remove не сделал. Я добавил, что Region и Remove правильно работали.