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

1 view
Skip to first unread message

gabriel

unread,
Nov 22, 2009, 3:44:30 PM11/22/09
to ColdBox Platform
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
experienced.

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

B. From the Transfer mailing list:

http://groups.google.com/group/transfer-dev/browse_thread/thread/19e192eb9cedabed?tvc=2

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

Thank you,
Gabriel

Dorioo

unread,
Nov 23, 2009, 9:53:02 AM11/23/09
to ColdBox Platform
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,
Gabriel
> --
> You received this message because you are subscribed to the Google Groups "ColdBox: A ColdFusion Framework" 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 more information, visit http://www.luismajano.com/projects/coldbox
> For Documentation, visit http://ortus.svnrepository.com/coldbox/trac.cgi

Luis Majano

unread,
Nov 23, 2009, 11:39:12 AM11/23/09
to col...@googlegroups.com
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
--
Luis F. Majano
President
Ortus Solutions, Corp

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

Luis Majano

unread,
Nov 23, 2009, 3:46:03 PM11/23/09
to col...@googlegroups.com
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
President
Ortus Solutions, Corp

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


Dorioo

unread,
Nov 23, 2009, 7:32:37 PM11/23/09
to col...@googlegroups.com
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
worked.

- 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

Luis Majano

unread,
Nov 23, 2009, 10:09:36 PM11/23/09
to col...@googlegroups.com
Awesome thanks.
Reply all
Reply to author
Forward
0 new messages