I am not sure why this started occurring recently, but after our server restarts it appears the Coldbox cache for our application can not be recovered.
Here is how we setup and maintain our global cache:
Our Config: applicationStartHandler = “Main.onAppInit”,
Main.onAppInit Method:
var ApplicationStorage=getPlugin("ApplicationStorage"); var Permissions=StructNew(); var Menu=StructNew(); var User=StructNew(); var qUserLevels=StructNew(); var MenuBuild=StructNew(); var sBase=StructNew(); //---------------------------------------------------------------------------------------------------- //setup data collectors using the coldbox caching engine getColdBoxOCM().set('DataUserLevels',getModel('Permissions').DataUserLevels(),180); getColdBoxOCM().set('DataCompany',getModel('Company').DataCompany(),180); getColdBoxOCM().set('DataStates',getModel('Information').DataStates(),180); getColdBoxOCM().set('DataMall',getModel('Mall').DataMall(),180); getColdBoxOCM().set('DataNav',getModel('Menu').DataNav(),180); //---------------------------------------------------------------------------------------------------- //setup security and save that data in the application scope to save processing power Permissions=getModel('Permissions'); Menu=getModel('Menu'); //set default application containers qUserLevels=Permissions.qUserLevels(HasMenu=0); for(qLvl=1;qLvl<=qUserLevels.recordCount;qLvl++){ sBase.Menu=StructNew(); sBase.Menu.qGetNav=queryNew(""); if(qUserLevels["HasMenu"][qLvl] GT 0){ MenuBuild=Menu.sGetNav(LevelID=qUserLevels["LevelID"][qLvl]); sBase.Menu.qGetNav=MenuBuild.qGetNav; sBase.Menu.arrayNav=MenuBuild.arrayNav; sBase.Menu.xmlNav=MenuBuild.xmlNav; sBase.Menu.arrayNavMenuItems=MenuBuild.arrayNavMenuItems; } sBase.UserLevelRules=Permissions.qUserLevelRules(LevelID=qUserLevels["LevelID"][qLvl]); ApplicationStorage.setVar(Name=qUserLevels["TextDesc"][qLvl],Value=sBase); sBase=StructNew(); } //setup global approved events MenuBuild=ApplicationStorage.getVar(Name="Systems"); MenuBuild.Menu.arrayNavMenuItems=Menu.sGetSystems(); ApplicationStorage.setVar(Name="Systems",value=MenuBuild); //---------------------------------------------------------------------------------------------------- Instance.appinitLogger.info('Application Restarted');Our preProcess interceptor to make sure the cache is working named DataContainers:
//verify the data collectors are setup if(!getColdboxOCM().lookup("DataCompany")){ getColdBoxOCM().set('DataCompany',getModel('Company').DataCompany(),180); } if(!getColdboxOCM().lookup("DataMall")){ getColdBoxOCM().set('DataMall',getModel('Mall').DataMall(),180); } if(!getColdboxOCM().lookup("DataStates")){ getColdBoxOCM().set('DataStates',getModel('Information').DataStates(),180); } if(!getColdboxOCM().lookup("DataUserLevels")){ getColdBoxOCM().set('DataUserLevels',getModel('Permissions').DataUserLevels(),180); } if(!getColdboxOCM().lookup("DataNav")){ getColdBoxOCM().set('DataNav',getModel('Menu').DataNav(),180); }An example of how we are using the cache in our Permissions Model:
var AppLevels=UserLevels(); return AppLevels; var qUserLevels=Instance.DataUserLevels; var qUserLevelsOut=[]; Select LevelID,TextDesc,HasMenu From qUserLevels Where 0=0 And LevelID = And HasMenu >= return qUserLevelsOut;The error we are receiving looks something like this: