• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Restarting a different applicaiton?

Participant ,
Dec 11, 2009 Dec 11, 2009

Copy link to clipboard

Copied

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?

TOPICS
Advanced techniques

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 13, 2009 Dec 13, 2009

Copy link to clipboard

Copied

bump

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 14, 2009 Dec 14, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 15, 2009 Dec 15, 2009

Copy link to clipboard

Copied

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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 15, 2009 Dec 15, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 16, 2009 Dec 16, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 16, 2009 Dec 16, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 16, 2009 Dec 16, 2009

Copy link to clipboard

Copied

Hi;

thanks - yes, I was just thinging "webservice" after my last post there.,...  my EXACT thought was:

admin app creates a key in the database table I already set up  [something nasty like a cfid+big_long_random_string]

admin app posts the key, and an ident string to the remote webapp.

remote webapp checks the ident string, if it's good, checks the key against the one the admin app stored, if that's good = onApplicationStart();

that ought to be secure enough and keep kiddeis from hammering at the database

might be a good idea to even implement a timeout or something as well...

anyway .. thanks.

-sean

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 17, 2009 Dec 17, 2009

Copy link to clipboard

Copied

An application restart is only relevant if you want to reset application variables in the admin application as well as in the slave application.However, you've so far mentioned no application-wide variables.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 06, 2010 Dec 06, 2010

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation