Config mode 0 and cached components

49 views
Skip to first unread message

RobM

unread,
Mar 21, 2012, 1:20:18 PM3/21/12
to mach-ii-for...@googlegroups.com
Hello, I'm using version 1.5 and trying to find a way to reload the cached components in the various environments (ex. production) without having to log into the application. I have considered upgrading and using the dashboard, but there are security concerns about having the dashboard in production, as it might be accessible from the outside and the password option is hardcoded into the config file. Also, there is a web cluster in place, meaning each time a release is made, someone would have to go in and manually reload the components on each node in the cluster. Is there any other way to manually reload the components without the user needing to log in, and perhaps a way to schedule it nightly?

Thanks in advance,
Rob

RobM

unread,
Mar 26, 2012, 7:34:26 AM3/26/12
to mach-ii-for...@googlegroups.com
Was it something I said? Or is that not possible?

Joe Bodell

unread,
Mar 26, 2012, 10:02:04 AM3/26/12
to mach-ii-for...@googlegroups.com
In the past (and present, actually) I've set up a flag in OnRequestStart() that looks for a url param that no one would ever ever try passing in.....

<cfif param exists (and its value is good, etc)>
    <cfset structClear(application) />
    <cfset onApplicationStart() />
</cfif>

It's extremely dirty, and probably exerts a non-zero load on the server for having to be checked on every request, but it's eminently usable and can easily be scheduled (just point your scheduled task at a url and attach ?superSpecialParamBomb=momerath to it)...

--Joe

--
To post to this group, send email to mach-ii-for...@googlegroups.com
For more options and to unsubscribe, visit this group at http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
 
SVN: http://svn.mach-ii.com/machii/
Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/



--
------------------------
Joe Bodell
joe.b...@gmail.com
(c) 952-465-5096

Joe Bodell

unread,
Mar 26, 2012, 10:08:05 AM3/26/12
to mach-ii-for...@googlegroups.com
Just to clarify -- this is a nuclear option, and it obviously kills everything that's stored in your application scope. I believe there is a method somewhere in the framework for clearing only its object cache...but the same approach could be used.

RobM

unread,
Mar 26, 2012, 10:18:49 AM3/26/12
to mach-ii-for...@googlegroups.com
Does it have to be OnRequestStart() or does doing it later cause the request to not complete? If not, it could be made into an event call with some validation instead of an arbitrary url param.


On Monday, March 26, 2012 10:02:04 AM UTC-4, Joe Bodell wrote:
In the past (and present, actually) I've set up a flag in OnRequestStart() that looks for a url param that no one would ever ever try passing in.....

<cfif param exists (and its value is good, etc)>
    <cfset structClear(application) />
    <cfset onApplicationStart() />
</cfif>

It's extremely dirty, and probably exerts a non-zero load on the server for having to be checked on every request, but it's eminently usable and can easily be scheduled (just point your scheduled task at a url and attach ?superSpecialParamBomb=​momerath to it)...

--Joe

On Mon, Mar 26, 2012 at 6:34 AM, RobM <anim...@gmail.com> wrote:
Was it something I said? Or is that not possible?


On Wednesday, March 21, 2012 1:20:18 PM UTC-4, RobM wrote:
Hello, I'm using version 1.5 and trying to find a way to reload the cached components in the various environments (ex. production) without having to log into the application. I have considered upgrading and using the dashboard, but there are security concerns about having the dashboard in production, as it might be accessible from the outside and the password option is hardcoded into the config file. Also, there is a web cluster in place, meaning each time a release is made, someone would have to go in and manually reload the components on each node in the cluster. Is there any other way to manually reload the components without the user needing to log in, and perhaps a way to schedule it nightly?

Thanks in advance,
Rob

--
To post to this group, send email to mach-ii-for-coldfusion@​googlegroups.com

For more options and to unsubscribe, visit this group at http://groups.google.com/​group/mach-ii-for-coldfusion?​hl=en
 
SVN: http://svn.mach-ii.com/machii/
Wiki / Documentation / Tickets: http://trac.mach-ii.com/​machii/

Joe Bodell

unread,
Mar 26, 2012, 10:22:37 AM3/26/12
to mach-ii-for...@googlegroups.com
You could do it in onRequestEnd() or somewhere else in the request sequence, or in an actual event call so it's not being checked on each and every request, sure :) The main reason I do it this way right now is that we have Mach-ii running within a larger legacy app, and we want to be able to reload ORM/coldspring services from anywhere. So we could probably create a procedural template to do the same thing....but hey, nuclear = good. Or something.

But yes, more than one way to skin this particular cat. The key is knocking out the current contents of the application scope and hitting onApplicationStart(), which should reload the framework and cached components, etc.

--Joe

--
To post to this group, send email to mach-ii-for...@googlegroups.com

For more options and to unsubscribe, visit this group at http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
 
SVN: http://svn.mach-ii.com/machii/
Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/

RobM

unread,
Mar 26, 2012, 10:24:19 AM3/26/12
to mach-ii-for...@googlegroups.com
Am I right in guessing that most people let it load with the application scope when config_mode = 0?

Kurt Wiersma

unread,
Mar 26, 2012, 12:30:46 PM3/26/12
to mach-ii-for...@googlegroups.com
I usually use config mode = 0 or a special url var that set the config
mode to 1 for that request. I have my ant deployment script hit the
app with the special url var to trigger the reload once deploy is
done.

--Kurt

Reply all
Reply to author
Forward
0 new messages