title: Persisting data in infinispan cache to file
body: <p>I'm trying to persist cached data from infinispan 6.0.2 to a file, I'm using the embedded mode and this is the cache configuration:</p>
  
  <pre><code>ConfigurationBuilder builder = new ConfigurationBuilder();
  builder.eviction().strategy(EvictionStrategy.LRU).maxEntries(1)
        .persistence()
        .passivation(false) // save evicted entries to cache store
        .addSingleFileStore()
           .preload(true)
           .shared(false)
           .fetchPersistentState(true)
           .ignoreModifications(false)
           .purgeOnStartup(false)
           .location(System.getProperty("java.io.tmpdir")+"infinispan")
           //.async().enabled(true).threadPoolSize(5)
           .singleton()
              .enabled(true)
              .pushStateWhenCoordinator(true)
              .pushStateTimeout(20000);
  Configuration configuration = builder.build();
  </code></pre>
  
  <p>It does not work for me (and I don't have errors), the file store is created in the file system but contains only "FCS1" and if it's already created nothing happen (i.e. no update).
  Here is the code (nothing fancy) for adding key/value pairs to the cache:</p>
  
  <pre><code>// Avoid JMX problems related to org.infinispan already registered domain
  GlobalConfiguration globalConf = new GlobalConfigurationBuilder()
                                          //.clusteredDefault()
                                          .globalJmxStatistics()
                                          .mBeanServerLookup(DummyMBeanServer.lookup)
                                          .build();
  EmbeddedCacheManager manager1 = new DefaultCacheManager(globalConf, configuration);
  manager1.start();
  Cache&lt;String, String&gt; cache1 = manager1.getCache(); // default cache
  cache1.put("key11", "val11");
  cache1.put("key12", "val12");
  cache1.put("key13", "val13");
  cache1.evict("key11"); // a desperate attempt to move this key to the store
  cache1.stop();
  // when I restart the cache all data is lost
  cache1.start();
  </code></pre>