Weird behaviour in ehcache| View in Tracker
Reporter/Name(from Bugbase): Ben Ferdinandus / ()
Failure Type: Incorrectly functioning
Found In Build/Fixed In Build: adobe 2018.0.01+311402 / CF2018U4
Priority/Frequency: Normal / Some users will encounter
Locale/System: ALL / Windows 10 64 bit
Vote Count: 5
Problem Description: We have two applications which are using the same backend. We run those in 2 different coldfusion instances, and with a different application name. In the \cfusion\lib\ehcache.xml file we configured our own cacheregions. We use a Terracotta server to serve the cache to the 2 applications. This all works fine with CF2016, but with CF2018 we encountered a problem. • If we try to use cacheGet right after the server has started we get the error: Cache region with name userInfo does not exist. • Then if we put an item in that cacheregion, (cachePut) and then chacheGet it, the problem is gone. To investigate what was happening I used a java object to get the cache names. (var joCacheManager=createObject("java", "net.sf.ehcache.CacheManager").getInstance();) When the server is just started up it looks like this: (with the userInfo we defined in the ehcache.xml) 1 userInfo 2 authcache 3 customcache 4 authtokenmappingcache If we then try to get an item from the region userInfo, we get the error: Cache region with name userInfo does not exist. Then we put an item in the region userInfo. That gives no error. If I then take a look at the cache regions I see the following: 1 userInfo 2 authcache 3 myApplicationCF2018userInfo 4 customcache 5 authtokenmappingcache There is an extra cacheregion consisting of the region name defined in ehcache.xml prefixed with the coldfusion application name. Now we can use cacheget to get items from the region userInfo. To take my investigation one step further I used cacheGetAllIds to see the items in the cacheregions. • writeDump(cacheGetAllIds("userInfo")); This command gives me the item I just put in the region userInfo • writeDump(cacheGetAllIds("myApplicationCF2018userInfo")); This however gives me the error:Cache region with name myApplicationCF2018userInfo does not exist. So to me it appears that there is a bug that creates a mystery cache region. And if the mystery region does not exist, cacheget throws an error. I have added a zipfile with my test code to reproduce the problem. Steps to Reproduce: Add a new region to \cfusion\lib\ehcache.xml Create an index.cfm and then try to use cacheGet("object1", "newCacheRegion"); Actual Result: Cache region with name newCacheRegion does not exist. Expected Result: The cacheGet command succeeds without errors. Any Workarounds: At the start of the application put some object in the newCacheRegion. Then try to get "object1".