7 Replies Latest reply on Apr 11, 2007 2:09 PM by Newsgroup_User

    Restart a single application

    rschoen
      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.

        • 1. Re: Restart a single application
          insuractive Level 3
          Why do you need to restart only 1 application?
          • 2. Re: Restart a single application
            Level 7
            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.

            • 3. Re: Restart a single application
              rschoen Level 1
              In short I need to reset all of my application scope variables. This only happens in onApplicationStart in the application.cfc.
              • 4. Re: Restart a single application
                joeDangelo Level 1
                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!
                • 5. Re: Restart a single application
                  Level 7
                  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.

                  • 6. Re: Restart a single application
                    insuractive Level 3
                    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.
                    • 7. Re: Restart a single application
                      Level 7
                      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.