javacachingjcs

Information about JCS


This is conjunction with my previous question https://stackoverflow.com/questions/8428911/jcs-disk-cache-data-retrieval

Does JCS read from disk even after the application is shutdown.i.e I have a JCS that writes to disk.The thing is one program does the caching that is writing to disk and another one reads from the disk.I run the writing program at one time and after a few minutes the read program is run.But when the read program is run,it comes up with null data even though the write program has successfully written to disk.Do caching systems work like this.Does it just use the disk for temporary storage,even though the cache writes the objects to disk.Does the information on the disk become invalid after application shutdown or restart. I want to know whether JCS with respect to the disk part works like a storage system.


Solution

  • Edit your cache.ccf file, add an option
    jcs.region.YOUR_CACHE_NAME.cacheattributes.DiskUsagePatternName=UPDATE
    Read this. Especially about DiskUsagePatternName.

    JCS cache = JCS.getInstance("calcCache");
    cache.put("keeeeeeeeeey", "vaaaaaaaalue");
    

    This simple example works normally.