Good day!
There is multiple update of stale cache entries. I've used EhCache and OSCache, but result is still the same.
I've written high concurrency site with heavy database queries (using Criteria queries). I've set up cache for 5 minutes expiring interval. So, each 5 minutes many users trying to load main page of my site, and there is many identical queries to database while query for first user doesn't completed and its results have been put in cache. So, site works too slow every 5 minutes...
Can I block other threads while first thread updates stale cache entry? Or can I give stale cashe entry value for other threads?
Thank you!
P.S.:
What I've tried in ehcache:
I've tried BlockingCache . SelfPopulatingCache, but it looks like this types of cache doesn't supports by hibernate.
What I've tried in oscache:
I've tried to use cache.blocking=false and cache.blocking=true in oscache.properties, but there is concurrent updates of stale enties in both cases :(
|