无法添加对象速度缓存
问题描述:
我刚刚在我的电脑上安装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
答
您是否使用Secondaries选项创建了namedCache“myCache”?使用单个服务器群集并使用-Secondaries 1选项创建NamedCache时,我遇到了相同的冻结问题。似乎主服务器无法复制要放入缓存的对象。 尝试删除指定的chache并使用-secondaries 0选项重新创建它。
是的。这实际上是问题所在。谢谢。 – Patrik 2008-12-28 20:47:07