0

From the document, I saw:

Ehcache 3 only offers persistence in the case of clean shutdowns (close() was called). If the JVM crashes there is no data integrity guarantee. At restart, Ehcache will detect that the CacheManager wasn’t cleanly closed and will wipe the disk storage before using it.

Does it mean there's no way I can eagerly flush entries (or some entries I know updated for sure) to disk?

Also, I'd like to know where the close() hooked? Will it be triggered if I manually kill the jvm?

Thanks

Leon

anuni
  • 889
  • 10
  • 26

1 Answers1

0

No. It won't. But you could add a shutdown hook yourself. However, it works with memory mapped files and in case of a crash, you never know the state of a currently written entry.

Support a clean save is actually an enterprise feature. It is called fast restore.

Note that Ehcache isn't a store, it's a cache. So, fast restore is used to quickly load a cache after a crash. No to save data.

Henri
  • 5,551
  • 1
  • 22
  • 29