can I load database data in global.asa

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • c676228

    can I load database data in global.asa

    Hi everyone,
    I never used global.asa. I am thinking of load some data in
    application_ons tart which is read only from database(I mean the data will
    never be changed in any asp pages of the applcation) and so any session for
    this application doesn't need to reload data from database again, reduce
    database connection and procedure call.
    Am I right? just doesn't see that kind of comments on-line.
    I want to make sure this is the right concept before I am heading too far.
    --
    Betty
  • Slim

    #2
    Re: can I load database data in global.asa

    Yes you can.

    but don't load objects into Application or Session variables this is
    inefficient. You an load the values you retrieved from the database into
    Application or Session variables

    "c676228" <bettys@communi ty.nospamwrote in message
    news:3A884041-D686-4656-BBED-D7129450B660@mi crosoft.com...
    Hi everyone,
    I never used global.asa. I am thinking of load some data in
    application_ons tart which is read only from database(I mean the data will
    never be changed in any asp pages of the applcation) and so any session
    for
    this application doesn't need to reload data from database again, reduce
    database connection and procedure call.
    Am I right? just doesn't see that kind of comments on-line.
    I want to make sure this is the right concept before I am heading too far.
    --
    Betty

    Comment

    • Walter Wang [MSFT]

      #3
      Re: can I load database data in global.asa

      Hi Betty,

      I agree with Slim. You could load read-only data from database and save it
      with application scope. Though you need to be caution with the data size,
      loading too many data into application state sometimes will decrease your
      performance instead.

      You can refer to following article for more info:

      #IIS 5.0 Resource Guide - ASP Best Practices
      Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.

      s/reskit/iisappa.mspx

      Please let us know whether or not you need further information regarding
      this post. Thanks.

      Sincerely,
      Walter Wang (wawang@online. microsoft.com, remove 'online.')
      Microsoft Online Community Support

      =============== =============== =============== =====
      Get notification to my posts through email? Please refer to
      Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.

      ications. If you are using Outlook Express, please make sure you clear the
      check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
      promptly.

      Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
      where an initial response from the community or a Microsoft Support
      Engineer within 1 business day is acceptable. Please note that each follow
      up response may take approximately 2 business days as the support
      professional working with you may need further investigation to reach the
      most efficient resolution. The offering is not appropriate for situations
      that require urgent, real-time or phone-based interactions or complex
      project analysis and dump analysis issues. Issues of this nature are best
      handled working with a dedicated Microsoft Support Engineer by contacting
      Microsoft Customer Support Services (CSS) at
      http://msdn.microsoft.com/subscripti...t/default.aspx.
      =============== =============== =============== =====

      This posting is provided "AS IS" with no warranties, and confers no rights.

      Comment

      • c676228

        #4
        Re: can I load database data in global.asa

        Thank you, Slim and Walter. Probably I will write a test asp page to load
        this chunk of data to see if it will impact on the performance or not.
        --
        Betty


        "Walter Wang [MSFT]" wrote:
        Hi Betty,
        >
        I agree with Slim. You could load read-only data from database and save it
        with application scope. Though you need to be caution with the data size,
        loading too many data into application state sometimes will decrease your
        performance instead.
        >
        You can refer to following article for more info:
        >
        #IIS 5.0 Resource Guide - ASP Best Practices
        Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.

        s/reskit/iisappa.mspx
        >
        Please let us know whether or not you need further information regarding
        this post. Thanks.
        >
        Sincerely,
        Walter Wang (wawang@online. microsoft.com, remove 'online.')
        Microsoft Online Community Support
        >
        =============== =============== =============== =====
        Get notification to my posts through email? Please refer to
        Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.

        ications. If you are using Outlook Express, please make sure you clear the
        check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
        promptly.
        >
        Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
        where an initial response from the community or a Microsoft Support
        Engineer within 1 business day is acceptable. Please note that each follow
        up response may take approximately 2 business days as the support
        professional working with you may need further investigation to reach the
        most efficient resolution. The offering is not appropriate for situations
        that require urgent, real-time or phone-based interactions or complex
        project analysis and dump analysis issues. Issues of this nature are best
        handled working with a dedicated Microsoft Support Engineer by contacting
        Microsoft Customer Support Services (CSS) at
        http://msdn.microsoft.com/subscripti...t/default.aspx.
        =============== =============== =============== =====
        >
        This posting is provided "AS IS" with no warranties, and confers no rights.
        >
        >

        Comment

        • Craig Douglas

          #5
          Re: can I load database data in global.asa

          I tried that very thing when I was new to this [ with a news site] and found
          it to be a complete waste of time.

          unfortunately it means making the first user wait while all this data is
          loaded in. Try demoing a sluggish-to-start site to your boss and see the
          reaction.

          If you're thinking a few variables, then it might perform faster in the very
          short term, if you're thinking a dataset......th en no.

          In terms of application development, you're storing up problems for yourself
          later. The style of construction won't scale to anything meaning full,
          which, if your app is at all successful, will be a problem.

          A problem you will have is having to re-boot your app every time the data in
          the database is changed[even if not by the app]. (clearing the sessions of
          any users who are using it)

          Craig








          "c676228" <bettys@communi ty.nospamwrote in message
          news:3A884041-D686-4656-BBED-D7129450B660@mi crosoft.com...
          Hi everyone,
          I never used global.asa. I am thinking of load some data in
          application_ons tart which is read only from database(I mean the data will
          never be changed in any asp pages of the applcation) and so any session
          for
          this application doesn't need to reload data from database again, reduce
          database connection and procedure call.
          Am I right? just doesn't see that kind of comments on-line.
          I want to make sure this is the right concept before I am heading too far.
          --
          Betty

          Comment

          • Bob Barrows [MVP]

            #6
            Re: can I load database data in global.asa

            Craig Douglas wrote:
            I tried that very thing when I was new to this [ with a news site]
            and found it to be a complete waste of time.
            >
            unfortunately it means making the first user wait while all this data
            is loaded in.
            vs. making every user wait for the data? hmmm
            Try demoing a sluggish-to-start site to your boss and
            see the reaction.
            I dunno. My boss understands the reasons for this. Of course, it can be
            mitigated ... instead of loading everything in global.asa, load the
            variables the first time they are used ... epspecially if they are rarely
            used. Another idea is to do this activity asynchronously via XMLHTTP (server
            or dlient-side).
            >
            If you're thinking a few variables, then it might perform faster in
            the very short term, if you're thinking a dataset......th en no.
            Depends on the size of the dataset, doesn't it?
            >
            In terms of application development, you're storing up problems for
            yourself later. The style of construction won't scale to anything
            meaning full, which, if your app is at all successful, will be a
            problem.
            Sorry, I just don't agree with this statement. It can be true if one
            overdoes caching, but it does not have to be true.
            >
            A problem you will have is having to re-boot your app every time the
            data in the database is changed[even if not by the app]. (clearing
            the sessions of any users who are using it)
            >
            <chuckleReboo t the app to update application variables?? How about
            creating a page that reloads them and calling that page when they need to be
            refreshed? Loading/refreshing the app variables does not have to take place
            in global.asa.

            If the data changes that frequently, it is probably not a good candidate to
            be cached in Application ... Session may be more suitable.


            --
            Microsoft MVP - ASP/ASP.NET
            Please reply to the newsgroup. This email account is my spam trap so I
            don't check it very often. If you must reply off-line, then remove the
            "NO SPAM"


            Comment

            • Mike Brind

              #7
              Re: can I load database data in global.asa


              "c676228" <bettys@communi ty.nospamwrote in message
              news:3A884041-D686-4656-BBED-D7129450B660@mi crosoft.com...
              Hi everyone,
              I never used global.asa. I am thinking of load some data in
              application_ons tart which is read only from database(I mean the data will
              never be changed in any asp pages of the applcation) and so any session
              for
              this application doesn't need to reload data from database again, reduce
              database connection and procedure call.
              Am I right? just doesn't see that kind of comments on-line.
              I want to make sure this is the right concept before I am heading too far.

              Tip 2 in the article here:
              http://msdn2.microsoft.com/en-gb/lib...asptips_topic3 is
              probably more like what you are looking for. Tip 3 is relevant too.

              I use Tip 2 for data that only changes once a month or so, and store a
              string of html in an Application level variable. Each time a new item is
              added, or an existing one amended, one line on the Add or Edit page script
              sets the Application level variable to an empty string, forcing a function
              to rebuild the string with the new data.

              --
              Mike Brind


              Comment

              Working...