In Luis’s CB book he references a technique of storing objects within the cache onApplicationStart(). I following the example code like so:
public boolean function onApplicationStart() output=false{
//Load ColdBox
loadColdBox();
//load data which rarely changes and prepare to place in ColdBox cache
var qBloodTypes = getPlugin(“ioc”).getBean(“BloodtypeService”).list();
//persist data in the cache until the application reinitializes
getColdBoxOCM().set(‘qBloodTypes’,qBloodTypes,0);
return true;
}
When I force the onApplicationStart() to fire I receive an error back indicating that getPlugin is undefined. I assumed that by executing loadColdBox() prior to setting up the objects was the right move since getPlugin() is part of the CB framework. Any ideas why this error would be occurring?
For what it's worth, I prefer to do these things in an Interceptor.
You can create a custom interception point that is also triggered by
the "configuration" method in the interceptor.