2008-11-19 66 views
1

我剛剛在我的電腦上安裝Velocity,似乎一切正常,但我不能將任何對象添加到緩存。我沒有檢索緩存本身的麻煩,但是當我嘗試添加一個對象時,所有內容都會凍結五分鐘,然後我會暫停一次。無法添加對象速度緩存

我的代碼連接到高速緩存主機(正常工作):

// Define Array for 1 cache host. 
ServerEndPoint[] servers = new ServerEndPoint[1]; 

// Specify Cache Host Details 
servers[0] = new ServerEndPoint(
     "COMPUTERNAME" /* Host */, 
     22233 /* Port */, 
     "DistributedCacheService" /* Service name */); 

// Pass configuration settings to CacheFactory constructor. 
m_cacheFactory = new CacheFactory(servers, 
     true /* Use routing client */, 
     false /* No local cache */); 

// Get the cache (works fine). 
Cache cache = m_cacheFactory.GetCache("MyCache"); 

我的代碼爲對象添加到緩存中(不工作):

// Get the cache. 
Cache cache = m_cacheFactory.GetCache("MyCache"); 

// Create the item to put in the cache. 
Product product = new Product(); 
product.Sku = "10000"; 
product.Name = "My Product"; 

// Put the object in the cache (The add method doesn't work either). 
cache.Put(product.Sku /* Key */, product /* Value */); 

通過集羣管理員界面,我已驗證緩存主機正在運行並且緩存本身存在。

任何人都有一個想法可能是什麼問題?

編輯:

我連着日誌接收器提供的緩存工廠,我已經驗證,有某種超時。緩存主機位於本地計算機上,防火牆已關閉。

CASClient - 超時試圖說服 到 的net.tcp:// l1441gbg:22233/distributedcacheservice,Velocity.DRM.SendReceive,警告,2008-11-20 11:06:29.988

回答

2

您是否使用Secondaries選項創建了namedCache「myCache」?使用單個服務器羣集並使用-Secondaries 1選項創建NamedCache時,我遇到了相同的凍結問題。似乎主服務器無法複製要放入緩存的對象。 嘗試刪除指定的chache並使用-secondaries 0選項重新創建它。

+0

是的。這實際上是問題所在。謝謝。 – Patrik 2008-12-28 20:47:07