global.asa - code outside Subs

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    global.asa - code outside Subs

    In global.asa I have some code outside all the Subs.

    I have some confirmation that it is being executed OnStart.
    Yet I can's see if it is executed OnEnd.

    The literature I have says that OnEnd the Sub Application_OnE nd is executed,
    but is does not say that anything else is executed

    Actually I even can't understand if global.asa is permited to have any code
    outside the Subs

    Could someone comment on this?


  • Curt_C [MVP]

    #2
    Re: global.asa - code outside Subs

    first off, the Application_OnE nd is not reliable....and should not be
    counted on.
    Beyond that, could you give a specific example of what you are trying to do?

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software



    <aa> wrote in message news:u2WI3wuzDH A.2676@tk2msftn gp13.phx.gbl...[color=blue]
    > In global.asa I have some code outside all the Subs.
    >
    > I have some confirmation that it is being executed OnStart.
    > Yet I can's see if it is executed OnEnd.
    >
    > The literature I have says that OnEnd the Sub Application_OnE nd is[/color]
    executed,[color=blue]
    > but is does not say that anything else is executed
    >
    > Actually I even can't understand if global.asa is permited to have any[/color]
    code[color=blue]
    > outside the Subs
    >
    > Could someone comment on this?
    >
    >[/color]


    Comment

    • Foo Man Chew

      #3
      Re: global.asa - code outside Subs

      > In global.asa I have some code outside all the Subs.

      Could you be more specific? What "code" is "outside all the subs"? Could
      you show your global.asa? How do you expect it to be executed? How can you
      tell it's being executed OnStart (on start of WHAT) and not OnEnd (again, on
      end of WHAT)?


      Comment

      • Guest's Avatar

        #4
        Re: global.asa - code outside Subs

        Thank you for asking questions

        In global.asa outside all the Subs, I define and initiate a variable to
        hold a path to a file to which I write something on Application_OnE nd and
        read from on Application_OnS tart. I use MapPath and do it outside Subs
        because MapPath for some reason does not work well inside Application
        On_End.

        My question is: what is the lifetime of that variable? Does it get lost as
        soon the global.asa is executed? Or it is stored somewhere?

        From my 2 year experience with nt4/iis it seems that it is either stored
        like an Application scope variable or (more likely) this out-of-subs code
        gets executed OnEnd as well. This is proven that file in question has been
        consistently found and records were read from it OnStart and added to it
        OnEnd.

        The reason I am asking this question is that I moved to w2k server and there
        the impression is that the OnEnd event is not fired at all. The log is
        registering the times the application starts, but no traces of application
        stops



        <aa> wrote in message news:u2WI3wuzDH A.2676@tk2msftn gp13.phx.gbl...[color=blue]
        > In global.asa I have some code outside all the Subs.
        >
        > I have some confirmation that it is being executed OnStart.
        > Yet I can's see if it is executed OnEnd.
        >
        > The literature I have says that OnEnd the Sub Application_OnE nd is[/color]
        executed,[color=blue]
        > but is does not say that anything else is executed
        >
        > Actually I even can't understand if global.asa is permited to have any[/color]
        code[color=blue]
        > outside the Subs
        >
        > Could someone comment on this?
        >
        >[/color]


        Comment

        • Guest's Avatar

          #5
          Re: global.asa - code outside Subs

          In which sense is it unreliable?
          I have been using is on nt4/iis4 for 2 years now to save page hit counters -
          it seemed to work fine.
          Saving application variables is one of the most common usage of global.asa
          and it relies heavily on OnEnd.
          The only unreliability I noticed that it is difficult to tell when exactly
          this even is expected to fire. But it looks like it had been firing at the
          end of the day.
          I keep a log on my provider of server down times recording date and time
          when thevapplication end and application start - and it has beed quite
          consistent.


          "Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
          news:uQntr7uzDH A.716@TK2MSFTNG P12.phx.gbl...[color=blue]
          > first off, the Application_OnE nd is not reliable....and should not be
          > counted on.
          > Beyond that, could you give a specific example of what you are trying to[/color]
          do?[color=blue]
          >
          > --
          > Curt Christianson
          > Owner/Lead Developer, DF-Software
          > www.Darkfalz.com
          >
          >
          > <aa> wrote in message news:u2WI3wuzDH A.2676@tk2msftn gp13.phx.gbl...[color=green]
          > > In global.asa I have some code outside all the Subs.
          > >
          > > I have some confirmation that it is being executed OnStart.
          > > Yet I can's see if it is executed OnEnd.
          > >
          > > The literature I have says that OnEnd the Sub Application_OnE nd is[/color]
          > executed,[color=green]
          > > but is does not say that anything else is executed
          > >
          > > Actually I even can't understand if global.asa is permited to have any[/color]
          > code[color=green]
          > > outside the Subs
          > >
          > > Could someone comment on this?
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Curt_C [MVP]

            #6
            Re: global.asa - code outside Subs

            Exactly... most people try to use it for when a person "leaves" the site. As
            long as you can wait for the actual session expiration it should work....
            They expect the "X" from the browser to fire it, which we all know doesnt'
            work

            --
            Curt Christianson
            Owner/Lead Developer, DF-Software



            <aa> wrote in message news:OJgH3$vzDH A.2456@TK2MSFTN GP12.phx.gbl...[color=blue]
            > In which sense is it unreliable?
            > I have been using is on nt4/iis4 for 2 years now to save page hit[/color]
            counters -[color=blue]
            > it seemed to work fine.
            > Saving application variables is one of the most common usage of global.asa
            > and it relies heavily on OnEnd.
            > The only unreliability I noticed that it is difficult to tell when exactly
            > this even is expected to fire. But it looks like it had been firing at the
            > end of the day.
            > I keep a log on my provider of server down times recording date and time
            > when thevapplication end and application start - and it has beed quite
            > consistent.
            >
            >
            > "Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
            > news:uQntr7uzDH A.716@TK2MSFTNG P12.phx.gbl...[color=green]
            > > first off, the Application_OnE nd is not reliable....and should not be
            > > counted on.
            > > Beyond that, could you give a specific example of what you are trying to[/color]
            > do?[color=green]
            > >
            > > --
            > > Curt Christianson
            > > Owner/Lead Developer, DF-Software
            > > www.Darkfalz.com
            > >
            > >
            > > <aa> wrote in message news:u2WI3wuzDH A.2676@tk2msftn gp13.phx.gbl...[color=darkred]
            > > > In global.asa I have some code outside all the Subs.
            > > >
            > > > I have some confirmation that it is being executed OnStart.
            > > > Yet I can's see if it is executed OnEnd.
            > > >
            > > > The literature I have says that OnEnd the Sub Application_OnE nd is[/color]
            > > executed,[color=darkred]
            > > > but is does not say that anything else is executed
            > > >
            > > > Actually I even can't understand if global.asa is permited to have any[/color]
            > > code[color=darkred]
            > > > outside the Subs
            > > >
            > > > Could someone comment on this?
            > > >
            > > >[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • Guest's Avatar

              #7
              Re: global.asa - code outside Subs

              Not sure.
              You seem to mean Session OnEnd, whereas I mean Application OnEnd

              "Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
              news:uZZh4SwzDH A.536@tk2msftng p13.phx.gbl...[color=blue]
              > Exactly... most people try to use it for when a person "leaves" the site.[/color]
              As[color=blue]
              > long as you can wait for the actual session expiration it should work....
              > They expect the "X" from the browser to fire it, which we all know doesnt'
              > work
              >
              > --
              > Curt Christianson
              > Owner/Lead Developer, DF-Software
              > www.Darkfalz.com
              >
              >
              > <aa> wrote in message news:OJgH3$vzDH A.2456@TK2MSFTN GP12.phx.gbl...[color=green]
              > > In which sense is it unreliable?
              > > I have been using is on nt4/iis4 for 2 years now to save page hit[/color]
              > counters -[color=green]
              > > it seemed to work fine.
              > > Saving application variables is one of the most common usage of[/color][/color]
              global.asa[color=blue][color=green]
              > > and it relies heavily on OnEnd.
              > > The only unreliability I noticed that it is difficult to tell when[/color][/color]
              exactly[color=blue][color=green]
              > > this even is expected to fire. But it looks like it had been firing at[/color][/color]
              the[color=blue][color=green]
              > > end of the day.
              > > I keep a log on my provider of server down times recording date and time
              > > when thevapplication end and application start - and it has beed quite
              > > consistent.
              > >
              > >
              > > "Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
              > > news:uQntr7uzDH A.716@TK2MSFTNG P12.phx.gbl...[color=darkred]
              > > > first off, the Application_OnE nd is not reliable....and should not be
              > > > counted on.
              > > > Beyond that, could you give a specific example of what you are trying[/color][/color][/color]
              to[color=blue][color=green]
              > > do?[color=darkred]
              > > >
              > > > --
              > > > Curt Christianson
              > > > Owner/Lead Developer, DF-Software
              > > > www.Darkfalz.com
              > > >
              > > >
              > > > <aa> wrote in message news:u2WI3wuzDH A.2676@tk2msftn gp13.phx.gbl...
              > > > > In global.asa I have some code outside all the Subs.
              > > > >
              > > > > I have some confirmation that it is being executed OnStart.
              > > > > Yet I can's see if it is executed OnEnd.
              > > > >
              > > > > The literature I have says that OnEnd the Sub Application_OnE nd is
              > > > executed,
              > > > > but is does not say that anything else is executed
              > > > >
              > > > > Actually I even can't understand if global.asa is permited to have[/color][/color][/color]
              any[color=blue][color=green][color=darkred]
              > > > code
              > > > > outside the Subs
              > > > >
              > > > > Could someone comment on this?
              > > > >
              > > > >
              > > >
              > > >[/color]
              > >
              > >[/color]
              >
              >[/color]


              Comment

              • Curt_C [MVP]

                #8
                Re: global.asa - code outside Subs

                My bad... I mis-read it. It's been that type of day....

                --
                Curt Christianson
                Owner/Lead Developer, DF-Software



                <aa> wrote in message news:Ou9BrUwzDH A.1760@TK2MSFTN GP10.phx.gbl...[color=blue]
                > Not sure.
                > You seem to mean Session OnEnd, whereas I mean Application OnEnd
                >
                > "Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
                > news:uZZh4SwzDH A.536@tk2msftng p13.phx.gbl...[color=green]
                > > Exactly... most people try to use it for when a person "leaves" the[/color][/color]
                site.[color=blue]
                > As[color=green]
                > > long as you can wait for the actual session expiration it should[/color][/color]
                work....[color=blue][color=green]
                > > They expect the "X" from the browser to fire it, which we all know[/color][/color]
                doesnt'[color=blue][color=green]
                > > work
                > >
                > > --
                > > Curt Christianson
                > > Owner/Lead Developer, DF-Software
                > > www.Darkfalz.com
                > >
                > >
                > > <aa> wrote in message news:OJgH3$vzDH A.2456@TK2MSFTN GP12.phx.gbl...[color=darkred]
                > > > In which sense is it unreliable?
                > > > I have been using is on nt4/iis4 for 2 years now to save page hit[/color]
                > > counters -[color=darkred]
                > > > it seemed to work fine.
                > > > Saving application variables is one of the most common usage of[/color][/color]
                > global.asa[color=green][color=darkred]
                > > > and it relies heavily on OnEnd.
                > > > The only unreliability I noticed that it is difficult to tell when[/color][/color]
                > exactly[color=green][color=darkred]
                > > > this even is expected to fire. But it looks like it had been firing at[/color][/color]
                > the[color=green][color=darkred]
                > > > end of the day.
                > > > I keep a log on my provider of server down times recording date and[/color][/color][/color]
                time[color=blue][color=green][color=darkred]
                > > > when thevapplication end and application start - and it has beed quite
                > > > consistent.
                > > >
                > > >
                > > > "Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
                > > > news:uQntr7uzDH A.716@TK2MSFTNG P12.phx.gbl...
                > > > > first off, the Application_OnE nd is not reliable....and should not[/color][/color][/color]
                be[color=blue][color=green][color=darkred]
                > > > > counted on.
                > > > > Beyond that, could you give a specific example of what you are[/color][/color][/color]
                trying[color=blue]
                > to[color=green][color=darkred]
                > > > do?
                > > > >
                > > > > --
                > > > > Curt Christianson
                > > > > Owner/Lead Developer, DF-Software
                > > > > www.Darkfalz.com
                > > > >
                > > > >
                > > > > <aa> wrote in message news:u2WI3wuzDH A.2676@tk2msftn gp13.phx.gbl...
                > > > > > In global.asa I have some code outside all the Subs.
                > > > > >
                > > > > > I have some confirmation that it is being executed OnStart.
                > > > > > Yet I can's see if it is executed OnEnd.
                > > > > >
                > > > > > The literature I have says that OnEnd the Sub Application_OnE nd is
                > > > > executed,
                > > > > > but is does not say that anything else is executed
                > > > > >
                > > > > > Actually I even can't understand if global.asa is permited to have[/color][/color]
                > any[color=green][color=darkred]
                > > > > code
                > > > > > outside the Subs
                > > > > >
                > > > > > Could someone comment on this?
                > > > > >
                > > > > >
                > > > >
                > > > >
                > > >
                > > >[/color]
                > >
                > >[/color]
                >
                >[/color]


                Comment

                • Guest's Avatar

                  #9
                  Re: global.asa - code outside Subs

                  Never mind, Curt. What about my original query?

                  "Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
                  news:eSKVzfwzDH A.2180@TK2MSFTN GP12.phx.gbl...[color=blue]
                  > My bad... I mis-read it. It's been that type of day....
                  >
                  > --
                  > Curt Christianson
                  > Owner/Lead Developer, DF-Software
                  > www.Darkfalz.com
                  >
                  >
                  > <aa> wrote in message news:Ou9BrUwzDH A.1760@TK2MSFTN GP10.phx.gbl...[color=green]
                  > > Not sure.
                  > > You seem to mean Session OnEnd, whereas I mean Application OnEnd
                  > >
                  > > "Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
                  > > news:uZZh4SwzDH A.536@tk2msftng p13.phx.gbl...[color=darkred]
                  > > > Exactly... most people try to use it for when a person "leaves" the[/color][/color]
                  > site.[color=green]
                  > > As[color=darkred]
                  > > > long as you can wait for the actual session expiration it should[/color][/color]
                  > work....[color=green][color=darkred]
                  > > > They expect the "X" from the browser to fire it, which we all know[/color][/color]
                  > doesnt'[color=green][color=darkred]
                  > > > work
                  > > >
                  > > > --
                  > > > Curt Christianson
                  > > > Owner/Lead Developer, DF-Software
                  > > > www.Darkfalz.com
                  > > >
                  > > >
                  > > > <aa> wrote in message news:OJgH3$vzDH A.2456@TK2MSFTN GP12.phx.gbl...
                  > > > > In which sense is it unreliable?
                  > > > > I have been using is on nt4/iis4 for 2 years now to save page hit
                  > > > counters -
                  > > > > it seemed to work fine.
                  > > > > Saving application variables is one of the most common usage of[/color]
                  > > global.asa[color=darkred]
                  > > > > and it relies heavily on OnEnd.
                  > > > > The only unreliability I noticed that it is difficult to tell when[/color]
                  > > exactly[color=darkred]
                  > > > > this even is expected to fire. But it looks like it had been firing[/color][/color][/color]
                  at[color=blue][color=green]
                  > > the[color=darkred]
                  > > > > end of the day.
                  > > > > I keep a log on my provider of server down times recording date and[/color][/color]
                  > time[color=green][color=darkred]
                  > > > > when thevapplication end and application start - and it has beed[/color][/color][/color]
                  quite[color=blue][color=green][color=darkred]
                  > > > > consistent.
                  > > > >
                  > > > >
                  > > > > "Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
                  > > > > news:uQntr7uzDH A.716@TK2MSFTNG P12.phx.gbl...
                  > > > > > first off, the Application_OnE nd is not reliable....and should not[/color][/color]
                  > be[color=green][color=darkred]
                  > > > > > counted on.
                  > > > > > Beyond that, could you give a specific example of what you are[/color][/color]
                  > trying[color=green]
                  > > to[color=darkred]
                  > > > > do?
                  > > > > >
                  > > > > > --
                  > > > > > Curt Christianson
                  > > > > > Owner/Lead Developer, DF-Software
                  > > > > > www.Darkfalz.com
                  > > > > >
                  > > > > >
                  > > > > > <aa> wrote in message[/color][/color][/color]
                  news:u2WI3wuzDH A.2676@tk2msftn gp13.phx.gbl...[color=blue][color=green][color=darkred]
                  > > > > > > In global.asa I have some code outside all the Subs.
                  > > > > > >
                  > > > > > > I have some confirmation that it is being executed OnStart.
                  > > > > > > Yet I can's see if it is executed OnEnd.
                  > > > > > >
                  > > > > > > The literature I have says that OnEnd the Sub Application_OnE nd[/color][/color][/color]
                  is[color=blue][color=green][color=darkred]
                  > > > > > executed,
                  > > > > > > but is does not say that anything else is executed
                  > > > > > >
                  > > > > > > Actually I even can't understand if global.asa is permited to[/color][/color][/color]
                  have[color=blue][color=green]
                  > > any[color=darkred]
                  > > > > > code
                  > > > > > > outside the Subs
                  > > > > > >
                  > > > > > > Could someone comment on this?
                  > > > > > >
                  > > > > > >
                  > > > > >
                  > > > > >
                  > > > >
                  > > > >
                  > > >
                  > > >[/color]
                  > >
                  > >[/color]
                  >
                  >[/color]


                  Comment

                  Working...