Clearing cached singleton objects for development environments when using Wirebox

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

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

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

They look just like mine jeff. Issue a applicationStop() just in case to clear things up.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

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.

There has to be something else going on, You can check out the code it runs,but I cannot reproduce this.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano