2013-07-26 109 views

回答

1

您可以通过处理DataCacheException来做到这一点。例如:

DataCache cache = null; 

try 
{ 
    cache = new DataCache("MyCache"); 
} 
catch (DataCacheException cacheError) 
{ 
    // Handle exception: couldn't create DataCache object 
} 

try 
{ 
    cache.Put("test",test); 
} 
catch (DataCacheException cacheError) 
{ 
    // Handle exception: couldn't store object in cache 
} 

你可以在这个异常并Common Exceptions (Windows Server AppFabric Caching)常见错误列表检查属性的列表,你应该能够处理,包括超时和RetryLater见Exception Handling Overview (Windows Server AppFabric Caching)

相关问题