ehcache

Java Multithreaded Caching with Single Updater Thread

I have a web service that has ~1k request threads running simultaneously on average. These threads access data from a cache (currently on ehcache.) When the entries in the cache expire, the thread that hits the expired entry tries getting the new value from the DB, while the other threads also trying to hit this entry block, i.e. I use t...

Cache tags with Ehcache

I have 2 functions: first public String doA(Integer userId, String someValue) that I want to cache (taking into account parameters of function), and second public String doB(Integer userId) that should drops cache of function "doA" for current userId. Does Ehcache support something like memcached tags or anything other that can he...

How does EHCache implement its transactions?

Hi, The question might sound vague but I'm trying to understand the general concept of the EHCache transaction ability. Assuming I configure EHCache as a memory cache and I also configure it to cache a MyObject. Does EHCache clone the instance of MyObject I'm retrieving if this is done as a part of a transaction? I'm mainly asking bec...

EHCache refresh

In EHCache, is there a way to implement some kind of a db listener where the cahce will auto update if the data is out of sync? (e.g as soon as the user requests for data, the cahce checks if the data is out of sync, if yes...updates itself and returns the data, if not...just return the data from the cache)If someone can point me which p...

ehcache cache "streams" of data

I want to cache the response to image requests. The images are the results of dynamic resizing of a larger image. I am using ehcache already for some caching. I would like to use it here. I don't want ehcache to keep the resized image in memory; neither when cached or when being read in. How do I make ehcache only store on disk (no me...

Spring, JPA (Hibernate) & Ehcache Poor Performance

Hi folks, I have what I would assume is a pretty standard setup...spring, jpa (hibernate) and I'm trying to add ehcache. I have it all configured and verified that it's working...I'm logging the hibernate sql statements and cache statements and can see that the cache is getting invoked and that once the object is in the cache, when I t...

JPA/HIBERNATE - Are objects instances cached indexed just by id ?

Probably it is a basic question, but could not found the answer anywhere in the web. I am trying to use a second level cache (using ehcache) and just checked that some objects were being retrieved from database every time I tried to load them, the only difference was that I was not getting them by id but by a property that carries a SE...