3 Replies Latest reply on Aug 17, 2006 8:40 AM by shimi

    A single point of failure in ChainingCacheLoader

    shimi Newbie

      In the user documentation of the cache it is written:

      To alleviate single point of failure, we could combine this with a ChainingCacheLoader, where the first CacheLoader is a ClusteredCacheLoader, the second a TcpDelegatingCacheLoader, and the last a JDBCacheLoader, effectively defining our cost of access to a cache in increasing order of cost.


      This sounds like a good thing to have but this is not true. Since all the delegate methods at ChainingCacheLoader throws Exceptions.
      Lets take a look at the example above. When ChainingCacheLoader execute
      public void put(Fqn name, Map attributes) throws Exception
       {
       Iterator i = writeCacheLoaders.iterator();
       while (i.hasNext())
       {
       CacheLoader l = (CacheLoader) i.next();
       l.put(name, attributes);
       }
       }
      and there is an Exception in the first CacheLoader which is ClusteredCacheLoader, the second CacheLoader TcpDelegatingCacheLoader and the next one after will never be called