3 Replies Latest reply on Jan 24, 2013 10:48 PM by Ges George

    FileCache store not writing entries, init, start called and no obvious attempt to create buckets or write files.

    Megan Woods Newbie

      Hi Folks, happy new year etc.


      I am not seeing entries written to the file system during a cache.put(), stepping through the code during startup the init() and start() methods of the FileCacheStore are called.


      When I put an entry into this cache, FileCacheStrore.loadBucket() is called which returns null as there are no bucket files to load.


      Brake points on other methods in FileCacheStore are not being triggered, so I can only assume the writing of entries happens elsewhere.


      My understanding is that is passivation is set false then the following will occur "When passivation is disabled, whenever an element is modified, added or removed, then that modification is persisted in the backend store via the cache loader."


      The problem is that I am just not seeing this persistence in the FileCacheStore and in the directory "./tmpdir", there is a sub directory for the cache but no files are created.


      If any one has any suggestions please let know, I am assuming the issue is with my configuration.


      I have tried the following with 5.1.6.FINAL and 5.2.0.Beta6.



      Cheers Megan Woods



            final String location = "./tmpdir/";

             File f = new File(location);



              ConfigurationBuilder confBuild = new ConfigurationBuilder();




















               DefaultCacheManager dcm = new DefaultCacheManager(confBuild.build());


               Cache ch = dcm.getCache(CacheProviderConstants.RUNTIME_CACHE);


              ch.addListener(new InfiniSpanListener());



               for (int t = 0; t < 10; t++) {

                  ch.put(UUID.randomUUID(), "The cat sat on the mat");




        • 1. Re: FileCache store not writing entries, init, start called and no obvious attempt to create buckets or write files.
          Manik Surtani Master

          Looks like you've configured the cache store to persist asynchronously (see the .async() part of your config).  Try commenting this bit out and you should see the cache store persisting with every put().


          Your test is pretty short, so the asynchronous persistence thread probably hasn't had time to catch up. 

          • 3. Re: FileCache store not writing entries, init, start called and no obvious attempt to create buckets or write files.
            Ges George Newbie



            I seem to have a similar problem with the FileCacheStore where I do not see any files persisted to the file system. I'm using the latest release - 5.2.0.CR2. Here is what I'm trying.



                public static void main(String[] args) throws IOException, InterruptedException {

                    final DefaultCacheManager defaultCacheManager = cacheConfiguration();




                    final Cache<String, String> infinispanTest = defaultCacheManager.getCache("infinispanCache", true);












                static void writeToCache(Cache<String, String> cache) {

                    final String keyPrefix = "key";

                    final String valuePrefix = "value";



                    for (int i = 0; i < 1000; i++) {

                        cache.put(keyPrefix + i, valuePrefix + i);





                static DefaultCacheManager cacheConfiguration() throws IOException {

                    final ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();

                    final SingletonStoreConfigurationBuilder<FileCacheStoreConfigurationBuilder> builder = configurationBuilder.loaders()












                    final DefaultCacheManager defaultCacheManager = new DefaultCacheManager(builder.build());

                    return defaultCacheManager;




            Appreciate your help in resolving this.