CacheBox: ColdFusion 901: Custom Cache Regions Not Being Created

Hello All,

Using the latest ColdBox on development branch…

I’ve created some new cache regions in my CacheBox config that implement “CFColdBoxProvider”. Because CFColdBoxProvider extends CFProvider, I expected to see ColdBox create new custom namespaces within the ColdFusion managed EHCache; however, I do not see custom regions within EHCache–I only see “template” and “object”.

Looking into the code of CFProvider I wonder if its because the cache is not added using something like “cacheCreate(argumentCollection=myProps)”.

Here is a post by Rob Brooks-Bilson (aka bed jumper) that got me thinking: http://rob.brooks-bilson.com/index.cfm/2011/6/22/User-Defined-Caches-in-Coldfusion-90-and-901
Here is a direct link to the CFProvider (around line 196) https://github.com/ColdBox/coldbox-platform/blob/development/system/cache/providers/CFProvider.cfc

Is this a bug, or, am I misunderstanding?

Thanks,

Aaron

Hey Aaron,

Yes the CFProvider should be creating these custom regions for you. I
just verified the functionality and wrote a function to abstract it:

  function cacheTest() {

    var cacheManager = createObject("java",
"net.sf.ehcache.CacheManager").getInstance();
    var cacheName = "userTest";

    writedump(var= cacheManager.getCacheNames(), label="Before Invalid
get" );

    cacheGet( "___invalid___", cacheName );

    writedump(var= cacheManager.getCacheNames(), label="After Invalid
get" );

    cacheManager.removeCache(cacheName);

    writedump(var= cacheManager.getCacheNames(), label="After
Cleanup" );

  }

You should see the defined region show up in the After Invalid get
dump. If cacheGet throws an error can you post the error? It is
working on several of our servers running CF 9.01, CB-Development

Thanks,

.brett