-
1. Re: Documents on setting up an Invalidating cache
manik Jun 2, 2010 12:33 PM (in response to teknopaul)1 of 1 people found this helpfulWe essentially want a cache of Database entities, and want to invalidate these, when they change, without distributing the data across the cluster. We want very cheap put()s, which JBossCache can not really provide. Infinispan seems a good fit.
So we need to be able to
Insert current data (not do any invalidations) but put() invalidates? What is the method to make a local put() that does nothing over the network? A pointer to a document or the code would be helpful.
try:
cache.getAdvancedCache().withFlags(Flag.CACHE_MODE_LOCAL, Flag.SKIP_REMOTE_LOOKUP).put(key, value);
We also want to use the new funky async methods to be able to handle errors asynchronously, currently we do log minitoring.
So we would call putAsync() or removeAsync() and handle Exceptions in a separate thread.
Where can I find details of Exceptions throw?
The async() methods return a Future. When you call Future.get(), this may throw an ExecutionException which will wrap any underlying exception.
If one of the cluster members is offline for a while, we want to sent a durable message so that when it comes back it evict()s invalid entries.
This is for the wierd case when a JVM under really heavy load stops responing, GC sakes too long etc, but OS stays up and eventually JVM comes back and starts handling web requests with stale data since JBossCache has given up on it.
So we would like be able to determine the node that failed from the Exceptions, is that possible?
Hmm, sounds like you need to tune your JGroups failure detection to detect such lags and to make sure any messages are delivered. Have a read of FDVersusFD_SOCK.
HTH
Manik
-
2. Re: Documents on setting up an Invalidating cache
teknopaul Jun 2, 2010 3:15 PM (in response to manik)With that one liner I think we are probably good to go, at least for a PoC.
We both FD vs FD_SOCK running in the JGroups stack and that works quite well.
But now you come to mention it, the problem in JBossCache is there is a trade off between failing fast enough to not hang the system and catching errors.
With these async methods that trade-off is no longer ther, we just let JGroups keep trying.
Thanx Manik for the prompt reply.
P