{"action":"created","issue":{"url":"https://api.github.com/repos/ehcache/ehcache3/issues/712","labels_url":"https://api.github.com/repos/ehcache/ehcache3/issues/712/labels{/name}","comments_url":"https://api.github.com/repos/ehcache/ehcache3/issues/712/comments","events_url":"https://api.github.com/repos/ehcache/ehcache3/issues/712/events","html_url":"https://github.com/ehcache/ehcache3/issues/712","id":123429557,"number":712,"title":"data loss when init EHCacheManager","user":{"login":"yuankui","id":236535,"avatar_url":"https://avatars.githubusercontent.com/u/236535?v=3","gravatar_id":"","url":"https://api.github.com/users/yuankui","html_url":"https://github.com/yuankui","followers_url":"https://api.github.com/users/yuankui/followers","following_url":"https://api.github.com/users/yuankui/following{/other_user}","gists_url":"https://api.github.com/users/yuankui/gists{/gist_id}","starred_url":"https://api.github.com/users/yuankui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuankui/subscriptions","organizations_url":"https://api.github.com/users/yuankui/orgs","repos_url":"https://api.github.com/users/yuankui/repos","events_url":"https://api.github.com/users/yuankui/events{/privacy}","received_events_url":"https://api.github.com/users/yuankui/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-22T07:18:06Z","updated_at":"2015-12-22T10:44:00Z","closed_at":null,"body":"hello,\r\n\r\nIn code `org.ehcache.internal.store.disk.OffHeapDiskStore#recoverBackingMap`, there are the following logs\r\n```\r\nThe index for data file {} is out of date by {}ms, probably due to an unclean shutdown. Creating a new empty store\r\n```\r\nthat may cause all the data been ignored thus lossing all the data that persist before.\r\n\r\nSo In a Java web application, How to properlly shutdown EHCache to verify that all data in cache flushed into disk before application exited.\r\n\r\n\r\nhere is my code & xml\r\n\r\n```\r\nfinal URL myUrl = HelloServlet.class.getResource(\"/ehcache.xml\");\r\n        Configuration xmlConfig = null;\r\n        try {\r\n            xmlConfig = new XmlConfiguration(myUrl);\r\n        } catch (Exception e) {\r\n            e.printStackTrace();\r\n        }\r\n        cacheManager = CacheManagerBuilder.newCacheManager(xmlConfig);\r\n\r\n        System.out.println(\"hitting...\");\r\n        if (cacheManager.getStatus() != Status.AVAILABLE) {\r\n            System.out.println(\"cacheManager = \" + cacheManager.getStatus());\r\n            cacheManager.init();\r\n        }\r\n\r\n        cache = cacheManager.getCache(\"test\", String.class, String.class);\r\n```\r\n\r\nxml\r\n```\r\n<core:config xmlns:core=\"http://www.ehcache.org/v3\">\r\n\r\n    <core:service>\r\n        <core:persistence directory=\"/Users/yuankui/tmp/mydata\" />\r\n    </core:service>\r\n\r\n    <core:cache alias=\"test\">\r\n\r\n        <core:key-type copier=\"org.ehcache.internal.copy.SerializingCopier\">java.lang.String</core:key-type>\r\n\r\n        <core:value-type copier=\"org.ehcache.internal.copy.SerializingCopier\">java.lang.String</core:value-type>\r\n\r\n        <core:expiry>\r\n            <core:tti unit=\"minutes\">2</core:tti>\r\n        </core:expiry>\r\n\r\n        <core:eviction-prioritizer>LFU</core:eviction-prioritizer>\r\n\r\n        <core:resources>\r\n            <core:heap size=\"200\" unit=\"entries\" />\r\n            <core:offheap size=\"200\" unit=\"mb\" />\r\n            <core:disk size=\"2000\" persistent=\"true\" unit=\"mb\" />\r\n        </core:resources>\r\n    </core:cache>\r\n\r\n\r\n</core:config>\r\n```"},"comment":{"url":"https://api.github.com/repos/ehcache/ehcache3/issues/comments/166578792","html_url":"https://github.com/ehcache/ehcache3/issues/712#issuecomment-166578792","issue_url":"https://api.github.com/repos/ehcache/ehcache3/issues/712","id":166578792,"user":{"login":"yuankui","id":236535,"avatar_url":"https://avatars.githubusercontent.com/u/236535?v=3","gravatar_id":"","url":"https://api.github.com/users/yuankui","html_url":"https://github.com/yuankui","followers_url":"https://api.github.com/users/yuankui/followers","following_url":"https://api.github.com/users/yuankui/following{/other_user}","gists_url":"https://api.github.com/users/yuankui/gists{/gist_id}","starred_url":"https://api.github.com/users/yuankui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuankui/subscriptions","organizations_url":"https://api.github.com/users/yuankui/orgs","repos_url":"https://api.github.com/users/yuankui/repos","events_url":"https://api.github.com/users/yuankui/events{/privacy}","received_events_url":"https://api.github.com/users/yuankui/received_events","type":"User","site_admin":false},"created_at":"2015-12-22T10:44:00Z","updated_at":"2015-12-22T10:44:00Z","body":"okey.\r\n\r\nCACHE!\r\n\r\nthat's a GOOD EXCEUSE"}}