3 Replies Latest reply on Sep 25, 2014 2:16 AM by sowjanya86

    InvocationBatching is not enabled for defaultcache

    sowjanya86

      Hi, I am very new to treecache infinispan. i was trying to execute the tree cache i have my tree cache API below. and i want to know what the deprecated classes and what i need to use in new versions in treecache.

       

       

      import java.util.*;

      import org.infinispan.Cache;

      import org.infinispan.manager.DefaultCacheManager;

      import org.infinispan.tree.TreeCache;

      import org.infinispan.tree.TreeCacheFactory;

      import org.infinispan.tree.Fqn;

       

       

      public class Service {

      private static final org.infinispan.configuration.cache.Configuration Configuration = null;

       

       

        public static void main(String[] args){

       

        Cache cache = new DefaultCacheManager(Configuration).getCache();

          cache.getCacheConfiguration().invocationBatching().enabled();

        TreeCache tree = new TreeCacheFactory().createTreeCache(cache);

        tree.put("/persons/john", "surname", "Smith");

       

        Fqn johnFqn = Fqn.fromString("persons/john");

        Calendar calendar = Calendar.getInstance();

        calendar.set(1980, 5, 2);

        tree.put(johnFqn, "birthdate", calendar.getTime());

        }

      }



      I was getting the error like

       

      Exception in thread "main" org.infinispan.commons.CacheConfigurationException: invocationBatching is not enabled for cache '___defaultcache'. Make sure this is enabled by calling configurationBuilder.invocationBatching().enable()

        at org.infinispan.tree.TreeCacheFactory.createTreeCache(TreeCacheFactory.java:33)

        at org.infinispan.jboss.Service.main(Service.java:20)