ehcache-2

ehcache persist to disk issues

时光怂恿深爱的人放手 提交于 2019-12-03 02:42:33
问题 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... Write a value to a disk persistent cache. Shut down. Start up again and read that value. Here is my Java function: 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

ehcache persist to disk issues

允我心安 提交于 2019-12-02 16:17:22
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... Write a value to a disk persistent cache. Shut down. Start up again and read that value. Here is my Java function: 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")) {