Clearing cached singleton objects for development environments when using Wirebox

195 views
Skip to first unread message

Jeff Reese

unread,
Feb 2, 2012, 3:37:33 PM2/2/12
to ColdBox Platform
I just recently switched to CB 3.5 and started using Wirebox since the
getBean functionality was depreciated. We have wanted to move away
from Coldspring for a long time, and this was a perfect excuse. I have
to mention that the move has come with a very significant speed
increase. I am not sure if it is the new core CB or the switch from
Coldspring that caused this, but either way, I am very happy.

I have searched the docs on Wirebox and have search around this forum
and I am having a difficult time finding a way to clear the singleton
cache in my development environment. I have this setting in my
Coldbox.cfc, but I am seeing no mention of the singletonReload option
anywhere (maybe it was removed?):

wireBox = {
enabled = true,
singletonReload=false
};

The way around this has been to reinit each time, but I would prefer I
not have to do this.

Any help on this is greatly appreciated.

Thanks,

Jeff

Curt Gratz

unread,
Feb 2, 2012, 3:42:15 PM2/2/12
to col...@googlegroups.com
Jeff,

In development, you want the singletonReload set to true.

wirebox.singletonreload = true;

False for production.

That should take care of it for you.

Curt
________________________________________
From: col...@googlegroups.com [col...@googlegroups.com] on behalf of Jeff Reese [ther...@gmail.com]
Sent: Thursday, February 02, 2012 2:37 PM
To: ColdBox Platform
Subject: [coldbox:13571] Clearing cached singleton objects for development environments when using Wirebox

Thanks,

Jeff

--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/coldbox
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org

Jeff Reese

unread,
Feb 6, 2012, 1:44:36 PM2/6/12
to ColdBox Platform
Oops... I pasted the production config. In my local config, I am
setting singletonReload=true, but its not working. I have tested it by
setting it both ways and reiniting each time. I have also changed
other settings to make sure my environment is being detected correctly
(I also dumped getSetting('environment') to confirm). If this is the
correct place to change that setting, can you think of any other
settings that may be conflicting? Here are my two config setups:

Default for production:
coldbox = {
appName = "Kostizi",
eventName = "event",
debugMode = false,
handlersIndexAutoReload = false,
configAutoReload = false,

//Implicit Events
defaultEvent = "Page.build",
requestStartHandler = "Main.onRequestStart",
requestEndHandler = "",
applicationStartHandler = "Main.onAppInit",
applicationEndHandler = "",
sessionStartHandler = "",
sessionEndHandler = "",
missingTemplateHandler = "",

//Extension Points
UDFLibraryFile = "includes/helpers/ApplicationHelper.cfm",
coldboxExtensionsLocation = "",
modulesExternalLocation = [],
pluginsExternalLocation = "",
viewsExternalLocation = "",
layoutsExternalLocation = "",
handlersExternalLocation = "",
requestContextDecorator = "",

//Error/Exception Handling
exceptionHandler = "Main.onException",
onInvalidEvent = "Page.build",
customErrorTemplate = "",

//Application Aspects
handlerCaching = false,
eventCaching = true,
proxyReturnCollection = false,
flashURLPersistScope = "session",

messagebox_style_override = true
};

caches = {
// Named cache for all coldbox event and view template caching
template = {
provider =
"coldbox.system.cache.providers.CacheBoxColdBoxProvider",
properties = {
objectDefaultTimeout = 120,
objectDefaultLastAccessTimeout = 30,
useLastAccessTimeouts = true,
freeMemoryPercentageThreshold = 0,
reapFrequency = 2,
evictionPolicy = "LRU",
evictCount = 2,
maxObjects = 300,
objectStore = "ConcurrentSoftReferenceStore" //memory sensitive
}
}
};

//WireBox Integration
wireBox = {
enabled = true,
singletonReload=false
};


Development overrides:

function local(){
coldbox.ConfigAutoReload = true;
coldbox.HandlersIndexAutoReload = true;
coldbox.HandlerCaching = false;
coldbox.EventCaching = false;
coldbox.debugMode = true;
coldbox.EnableBugReports = true;
coldbox.EnableColdboxLogging = false;
coldbox.useSSL = 0;
wirebox.singletonReload = true;
}

I have been using coldbox since sometime around version 2.4 and have
migrated my settings quite a few times. I wouldn't be surprised if we
are using some antiquated settings, or if maybe some of them are
conflicting with each other.

Thanks for your help on this.

Jeff



On Feb 2, 1:42 pm, Curt Gratz <gra...@compknowhow.com> wrote:
> Jeff,
>
> In development, you want the singletonReload set to true.
>
> wirebox.singletonreload = true;
>
> False for production.
>
> That should take care of it for you.
>
> Curt
> ________________________________________
> From: col...@googlegroups.com [col...@googlegroups.com] on behalf of Jeff Reese [therm...@gmail.com]

Luis Majano

unread,
Feb 6, 2012, 1:53:51 PM2/6/12
to col...@googlegroups.com
They look just like mine jeff.  Issue a applicationStop() just in case to clear things up.

Nick

unread,
Feb 6, 2012, 3:10:19 PM2/6/12
to ColdBox Platform
I am experiencing the exact problem. I can't get my singletons to
reload in DEV. I have it set to
singletonReload=true.

My current workaround is to reinit the framework every time, which is
pain.

Luis Majano

unread,
Feb 6, 2012, 5:44:47 PM2/6/12
to col...@googlegroups.com
There has to be something else going on, You can check out the code it runs,but I cannot reproduce this.
Reply all
Reply to author
Forward
0 new messages