4 Replies Latest reply on Sep 2, 2010 6:59 AM by girishadat

    Do getCache() really need to start the cache?

    girishadat

      When I call getCache(String) for getting a named cache, why it is in started state always? Can't this cause inconvenience for applications which rely on the CacheListeners? Say, if I want to attach a cache listener to monitor all the cache data operations after starting the cache, there can be chances for such operations to occur after getCache() and before attaching CacheListener.

       

      JBC allowed me to get the cache reference in INITIALIZED state and attach listeners; and then only I need to start the cache, using start() method. It would be convenient if there is a getCache(String name, boolean start) API in CacheManager. I am using Infinispan 4.0.0 Final.