On Fri, Apr 24, 2015 at 7:58 AM, Ognen Duzlevski <[email protected]> wrote:
> Hello, > > Can someone point me to docs describing what happens to a named cache in > the following situations? > > 1. Two separate programs access the same cache (one for reading, one for > writing). The writer dies. Does the grid still keep the cache intact? > Yes, the cache should be intact. Don't see any reason why it wouldn't be. > > 2. One program creates a cache in a multiple machine grid, writes something > to it and unexpectedly dies. Does the cache automatically "go away" if no > programs are accessing it anymore? > No, the cache will remain. The lifecycle of a cache is defined by "create()" or "close()" method. If you don't call the "close()" method on a cache, it will not "go away". > What is the simplest way to persist the cache on disk for future use? I > wrote a separate program to use the ContinuousQuery thing but I feel the > cache engine itself should provide the functionality maybe. > I would utilize the "CacheStore" API for the write-through functionality. For example, you can store data into any JDBC-compliant store using "CacheJdbcBlobStore". There is also "CacheJdbcPojoStore", which should work with concrete types, not blobs, but I am not sure how to use it (will start another thread for it). > > Thanks! >
