Unable to add object to speed cache
I just installed Velocity on my computer and everything is working fine, except that I cannot add any objects to the cache.I have no problem fetching the cache itself, but when I try to add an object everything just hangs at for five minutes and then I get a timeout.
My code for connecting to the cache host (works great):
// 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");
My code for adding object to cache (doesn't work):
// 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 */);
Through the cluster admin interface, I verified that the host cache is running and that the cache itself exists.
Can anyone understand what the problem is?
EDIT:
I connected the log provider to the factory cache and I checked that there is some kind of timeout. The cache host is on my local machine and the firewall is disabled.
CASClient - Triggered time to talk to net.tcp: // l1441gbg: 22233 / distributedcacheservice, Velocity.DRM.SendReceive, warning, 2008-11-20 11: 06: 29.988
source to share
Did namedCache "myCache" create a Secondaries option? I faced the same freeze problem using one server cluster and creating a NamedCache with the -Secondaries 1 parameter. It seems that the main server cannot duplicate the object you are about to cache. Try deleting the named chache and re-creating it with the -secondaries 0 option.