Skip to main content
December 11, 2009
Question

Restarting a different applicaiton?

  • December 11, 2009
  • 3 replies
  • 1239 views

hum. small question, I have 2 applications, one app ~administers~ the other. I can restart the admin application easily enough with onApplicationStart(); , but how can I restart the slave application???

-thanks

-sean

No answers?>?>?

can this even be done?

This topic has been closed for replies.

3 replies

December 6, 2010

I would up having to do something like this:

<cfcomponent>
     <cffile action="read" 
file="#getDirectoryFromPath(getCurrentTemplatePath())#application-name"
variable="this.name" charset="utf-8" />
     <cfscript>
         //this.name = "newride-ss23fv3-grg346";
         this.applicationTimeout = createTimeSpan(2,0,0,0);
         this.clientmanagement= "yes";
         this.loginstorage = "session" ;

in the administration there is a manual link  and form to fill out to restart the application, basically it just  regenerates the application-name file so that when application.cfc gets  it's next request the application name has changed.

Just wondering if there are security issues or other problems that might be associated with doing things like this.

-thanks

-sean

BKBK
Braniac
December 16, 2009
hum. small question, I have 2 applications, one app ~administers~ the other. I can restart the admin application easily enough with onApplicationStart(); , but how can I restart the slave application???

I assume the slave application is in a subdirectory of the admin application. I also assume the slave application's Application.cfc is within that subdirectory. All that is needed is for the admin to open any cfm page in the slave application.

December 16, 2009

no - actually the slave is on a different domain altogether.

it is possible that at some point it could be on a different server! [but not very likely]

the check database flag thing on a new session works well, but seems like it could be better....

-sean

BKBK
Braniac
December 16, 2009

no - actually the slave is on a different domain altogether.

it is possible that at some point it could be on a different server! [but not very likely]

No problemo. You may use cfhttp to call a page in the slave application.

December 14, 2009

bump

December 14, 2009

<cfscript>
applicationTracker = createObject("java","coldfusion.runtime.ApplicationScopeTracker");
daapplication = applicationTracker.getApplicationScope("saidApplication");
applicationTracker.cleanUp(daapplication);
</cfscript>

December 15, 2009

I would up setting a flag in the database and looking for it on a new session in the slave application....

<cfquery name="applicationReStart" datasource="#application.dsn#">
            select value from Settings where name = 'ApplicationRestart';
        </cfquery>
       
        <cfif applicationReStart.value is "true" >
            <cfquery name="update" datasource="#application.dsn#">
                update Settings set
                value = 'false'
                where name = 'ApplicationRestart';
            </cfquery>
       
            <cfset onApplicationStart() />
       
        </cfif>