This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes EhCache and the fly likes Writing to File - And updating cache Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Caching » EhCache
Bookmark "Writing to File - And updating cache" Watch "Writing to File - And updating cache" New topic
Author

Writing to File - And updating cache

A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Hi,

We have a requirement to write to the file only when the element is moved out of the cache. How can we do this?

And is cache.put( new Element( key, value)); a good way of updating cache


Kesava Krishna
Ranch Hand

Joined: Sep 03, 2012
Posts: 42
Try writing a listener, which will get called on eviction of any element from the cache memory.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Writing to File - And updating cache