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

Restart a single application

Guest
Apr 10, 2007 Apr 10, 2007

Copy link to clipboard

Copied

I would like to find a way to restart just one of the applications that I have running on my server with out having to restart coldfusion. Restarting coldfusion would restart all of the application running.

TOPICS
Advanced techniques

Views

920

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
Advocate ,
Apr 10, 2007 Apr 10, 2007

Copy link to clipboard

Copied

Why do you need to restart only 1 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
LEGEND ,
Apr 10, 2007 Apr 10, 2007

Copy link to clipboard

Copied

rschoen wrote:
> I would like to find a way to restart just one of the applications that I have
> running on my server with out having to restart coldfusion. Restarting
> coldfusion would restart all of the application running.

What do you mean by "single application"? An individual web site
doesn't really start or stop. Are you just trying to reset global
variables? Are you talking about different instances of ColdFusion in a
mulit-home configuration? I'm not clear what you are looking for.

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
Apr 11, 2007 Apr 11, 2007

Copy link to clipboard

Copied

In short I need to reset all of my application scope variables. This only happens in onApplicationStart in the application.cfc.

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 ,
Apr 11, 2007 Apr 11, 2007

Copy link to clipboard

Copied

What I do is create a seperate function called SetAppVars in my Application.cfc. The OnApplicationStart function calls it, but I also put a conditional in the OnRequestStart function that calls the same function if I pass in a specific URL variable. Hope that helps!

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
LEGEND ,
Apr 11, 2007 Apr 11, 2007

Copy link to clipboard

Copied

rschoen wrote:
> In short I need to reset all of my application scope variables. This only happens in onApplicationStart in the application.cfc.

Another way you can do it, if you just want to do it once in while, is
temporarily set the application timeout to a few seconds or even zero.
Then run the app, then restore the application timeout. Not as robust
as the previous conditional suggestion, but sometimes one wants to test
how an app behaves when it is accessed for the first time and this
allows that.

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
Advocate ,
Apr 11, 2007 Apr 11, 2007

Copy link to clipboard

Copied

Can't you also call the onApplicationStart() function from a regular coldfusion page? I remember reading in the docs about being able to call the onSessionStart() function, but it didn't mention anything about the onApplicationStart() function.

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
LEGEND ,
Apr 11, 2007 Apr 11, 2007

Copy link to clipboard

Copied

LATEST
insuractive wrote:
> Can't you also call the onApplicationStart() function from a regular coldfusion
> page? I remember reading in the docs about being able to call the
> onSessionStart() function, but it didn't mention anything about the
> onApplicationStart() function.
>
Yes you can, the only caveat is to be careful how the function is
written. When it is called automatically during the start of an
application all application variables are appropriately locked. If
called at any other time the automatic locking does not occur. So be
aware of potential race conditions and code appropriately.

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