can I load database data in global.asa

Discussion in 'ASP General' started by c676228, Oct 25, 2006.

  1. c676228

    c676228 Guest

    Hi everyone,
    I never used global.asa. I am thinking of load some data in
    application_onstart 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
     
    c676228, Oct 25, 2006
    #1
    1. Advertising

  2. c676228

    Slim Guest

    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" <> wrote in message
    news:...
    > Hi everyone,
    > I never used global.asa. I am thinking of load some data in
    > application_onstart 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, Oct 26, 2006
    #2
    1. Advertising

  3. 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
    http://www.microsoft.com/technet/prodtechnol/windows2000serv/technologies/ii
    s/reskit/iisappa.mspx

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

    Sincerely,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    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/subscriptions/support/default.aspx.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Oct 26, 2006
    #3
  4. c676228

    c676228 Guest

    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
    > http://www.microsoft.com/technet/prodtechnol/windows2000serv/technologies/ii
    > s/reskit/iisappa.mspx
    >
    > Please let us know whether or not you need further information regarding
    > this post. Thanks.
    >
    > Sincerely,
    > Walter Wang (, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > 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/subscriptions/support/default.aspx.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
     
    c676228, Nov 2, 2006
    #4
  5. 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......then 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" <> wrote in message
    news:...
    > Hi everyone,
    > I never used global.asa. I am thinking of load some data in
    > application_onstart 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
     
    Craig Douglas, Nov 8, 2006
    #5
  6. 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......then 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)
    >

    <chuckle> Reboot 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"
     
    Bob Barrows [MVP], Nov 8, 2006
    #6
  7. c676228

    Mike Brind Guest

    "c676228" <> wrote in message
    news:...
    > Hi everyone,
    > I never used global.asa. I am thinking of load some data in
    > application_onstart 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/library/ms972335.aspx#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
     
    Mike Brind, Nov 8, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wayne
    Replies:
    2
    Views:
    476
    Wayne
    Nov 11, 2003
  2. Graham Mattingley

    Global.asa and database connections..

    Graham Mattingley, Jan 12, 2004, in forum: ASP General
    Replies:
    6
    Views:
    168
    Brynn
    Jan 14, 2004
  3. Vince C.
    Replies:
    1
    Views:
    241
    Vince C.
    Apr 3, 2004
  4. Lord Merlin

    Can if statements be used in global.asa?

    Lord Merlin, Jun 20, 2004, in forum: ASP General
    Replies:
    3
    Views:
    268
    Bob Barrows [MVP]
    Jun 20, 2004
  5. geshan
    Replies:
    2
    Views:
    112
    Bob Barrows [MVP]
    Jul 21, 2006
Loading...

Share This Page