title: ehcache persist to disk issues
body: <p>I want to do something with ehcache in Java that I think should be extremely simple, but I've spent enough time frustrating myself with the docs...</p>
  
  <ol>
  <li><p>Write a value to a disk persistent cache. Shut down.</p></li>
  <li><p>Start up again and read that value.</p></li>
  </ol>
  
  <p>Here is my Java function:</p>
  
  <pre class="lang-java prettyprint-override"><code>private static void testCacheWrite() {
  
    // create the cache manager from our configuration
    URL url = TestBed.class.getClass().getResource("/resource/ehcache.xml");
    CacheManager manager = CacheManager.create(url);
    // check to see if our cache exits, if it doesn't create it
    Cache testCache = null;
    if (!manager.cacheExists("test")) {
      System.out.println("No cache found. Creating cache...");
      int maxElements = 50000;
      testCache = new Cache("test", maxElements,
        MemoryStoreEvictionPolicy.LFU, true, null, true, 60, 30,
        true, Cache.DEFAULT_EXPIRY_THREAD_INTERVAL_SECONDS, null);
      manager.addCache(testCache);
      // add an element to persist
      Element el = new Element("key", "value");
      testCache.put(el);
      testCache.flush();
      System.out.println("Cache to disk. Cache size on disk: " +
        testCache.getDiskStoreSize());
    } else {
      // cache exists so load it
      testCache = manager.getCache("test");
      Element el = testCache.get("key");
      if (null == el) {
        System.out.print("Value was null");
        return;
      }
      String value = (String) el.getObjectValue();
      System.out.println("Value is: " + value);
    }
    manager.shutdown();
  }
  </code></pre>
  
  <p>And here is my cache configuration (ehcache.xml):</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="../config/ehcache.xsd"&gt;
    &lt;diskStore path="C:/mycache"/&gt;&lt;!-- java.io.tmpdir --&gt;
    &lt;defaultCache
      maxElementsInMemory="10000"
      eternal="true"
      timeToIdleSeconds="120"
      timeToLiveSeconds="120"
      overflowToDisk="true"
      maxElementsOnDisk="10000000"
      diskPersistent="true"
      diskExpiryThreadIntervalSeconds="120"
      memoryStoreEvictionPolicy="LRU" /&gt;
  &lt;/ehcache&gt;
  </code></pre>
  
  <p>Even though I see test.index and test.data files on disk after the first run, output from this function is always the following (it never seems to load the cache from disk):</p>
  
  <blockquote>
    <p>No cache found. Creating cache...<br/> 
    Cache to disk. Cache size on disk: 2</p>
  </blockquote>
  
  <p>I must be doing something dumb here, but I 'm not sure what!</p>