无法将对象添加到Velocity缓存中

时间:2008-11-19 16:10:43

标签: c# .net appfabric

我刚刚在我的计算机上安装了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

1 个答案:

答案 0 :(得分:2)

您是否使用Secondaries选项创建了namedCache“myCache”?我使用单个服务器群集遇到了相同的冻结问题,并使用-Secondaries 1选项创建了NamedCache。似乎主服务器无法复制您要放入缓存的对象。 尝试删除命名的chache并使用-secondaries 0选项重新创建它。

相关问题