ADODB connection stored as Session var

Results 1 to 4 of 4

Thread: ADODB connection stored as Session var

  1. #1
    Chrace Guest

    Default ADODB connection stored as Session var

    Been trying a while to figure out how to store an open DB connection as a session var - thus, not reopening the connection on every page but only once per user to optimize.<BR><BR>My idea was to use Session_onStart and Session_onEnd to open and close them. Anyone tried this?

  2. #2
    MG Guest

    Default RE: ADODB connection stored as Session var

    This is a NO-NO!! You should not open a connection until it is needed and then close it immediately. You can store your connection string in a application variable rather than an include file.

  3. #3
    Join Date
    Dec 1969

    Default You don't want to do this!

    There are numerous articles, both here and at that explain why you don&#039t want to store adodb connections or recordsets in session variables.

  4. #4
    Steve Cimino Guest

    Default Do not pass GO, do not collect $200

    Understandable, you&#039re trying to get rid of the overhead of a database connection per page, and you think it will do better if you only have it open once.<BR><BR>This could be fine, if you have a limited number of users, and depends on heavy traffic time. However, what if 2 months from now, the number of users triple? You&#039ll bottleneck your applications, even though right now everything seems more efficient.<BR><BR>You should always code towards scalability. The apps I write sometimes only have one hit a day. Others have several thousand. There is no difference in how these are written.<BR><BR>Internet development is a bit different than desktop/distributed development. Search for some articles on this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts