EHC ❯ NonStopCache as an underlying cache of the BlockingCache doesn't work
-
Bug
-
Status: Closed
-
1 Critical
-
Resolution: Fixed
-
ehcache-core
-
-
asingh
-
Reporter: gykwok
-
December 20, 2010
-
0
-
Watchers: 2
-
July 27, 2012
-
January 14, 2011
Description
http://forums.terracotta.org/forums/posts/list/4668.page
Percondition: server is running and is not stopped. There is only one thread calling the get() on the blockingCache. Run code: this.cacheName = “TestNonStopCache”; Ehcache ehcache = cacheManager.getEhcache(this.cacheName);
Element value = ehcache.get(“randomString”); // return null
ehcache.put(new Element(“abc”, “def”)); // successful
blockingCache = new BlockingCache(ehcache);
blockingCache.get(“abc”); // value returned
blockingCache.get(“anotherVeryRandomString”); // value not in cache. It blocks a short period and throws,
Caused by: net.sf.ehcache.constructs.nonstop.NonStopCacheException: getQuite for key - ‘ anotherVeryRandomString ‘ timed out at net.sf.ehcache.constructs.nonstop.behavior.ExceptionOnTimeoutBehavior.getQuiet(ExceptionOnTimeoutBehavior.java:69) at net.sf.ehcache.constructs.nonstop.behavior.ExecutorBehavior.getQuiet(ExecutorBehavior.java:119) at net.sf.ehcache.constructs.nonstop.NonStopCache.getQuiet(NonStopCache.java:249) at net.sf.ehcache.constructs.blocking.BlockingCache.get(BlockingCache.java:136) at net.sf.ehcache.constructs.blocking.BlockingCache.get(BlockingCache.java:231)
Expected result: get() should return null instead of throwing an exception.
Fixed in trunk.