FYI: Possible future problem with CB and built in Transfer support

Hi Luis,

A. Mark Mandel is working on a pluggable cache for Transfer with the
default being EHCache. I've been playing around with it and stumbled
onto a problem where every time I "reinit" my coldbox app, a new
instance of EHCache is created. If I "reinit" often enough, I run out
of memory.

Mark has found the cause and it appears that EHCache has to be stopped
when the application stops. He's still working on the implementation
but I wanted to bring it up here as the built in Colbox Transfer
support will likely have to call whatever "shutdown" implementation
Mark uses when an app is reinit to prevent the memory problems I

Just wanted to bring it up now for what I presume will become the
future version of Transfer.

B. From the Transfer mailing list:

"I'll expose the EHCacheManager through the CacheMonitor (which is the
thing on the Monitor I need to do), but I'm wondering if it makes more
to have a TransferFactory.shutdown() method as a general method, which
similarly on the CacheProvider, that needs to be called
or if it's worth simply doing this by a cache by cache basis through

Thank you,

The implementation Mark chose was "TransferFactory.shutdown()".

Is this currently possible: On reinit, hook into the existing cache,
check if Transfer is in there, call shutdown() on it, and proceed
with reiniting?

I'm still experimenting with different interception points but it
appears that, on reinit, a new cache is created and so the transfer
object in the old cache is gone leaving me a ehcache instance forever.

Thank you,

I will check on this. I beleive the solution is to fire a new
interceptor when the framework reinits. I will add this and let you
know where

Check the nightly build.

Two new interception points:

applicationEnd - shot by the Application.cfc application end
preReinit - shot by ColdBox before reinitializing.

Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform:
Linked In:
IECFUG Manager:

A. Fantastic! It's working great. The ehcache manager threads are
"shutdown" once my interceptor checks if the TransferFactory is in the
coldbox cache, gets it if yes, and runs shutdown() on it on the two
new interception points.

B. Small bug though. In the advanced application template (no
inheritance), the "onApplicationEnd" function makes a reference to the
"Application" scope which I don't think exists at that point. I had to
changed it to reference the argument that is passed in and then it

- FROM -

<cfargument name="appScope" type="struct" required="true">
<cfset application.cbBootstrap.onApplicationEnd(argumentCollection=arguments)>

- TO -

<cfargument name="appScope" type="struct" required="true">
<cfset arguments.appScope.cbBootstrap.onApplicationEnd(argumentCollection=arguments)>

- Gabriel

Awesome thanks.