Keeping connections open

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Keeping connections open

    I am very new to asp, and I am wondering what is the best way to get around a this problem

    I use asp to give me a status on a database which is changing frequently. I open a connection to the database at the begining of the the script, and then execute a command to obtain a recordset

    If I want the information in the asp page to be constantly up to date, the only way I can see to do this is to refresh the page at intervals, which opens the database again, and executes command again

    Is there a neater way to do this? Or is this the only way

    aidanh
    aidanh Guest

  2. Similar Questions and Discussions

    1. MX Open Database Connections
      Did MX do away with the settings for database connections? We just switched from Oracle 8i to Oracle 9i and have seen some connectivity failures. ...
    2. MX 6.1 / MySQL 3.23 - Open Connections
      We have been noticing that the Client Variables db connections are not closing even when we set timeouts and turn off Connection pooling. I've...
    3. Keeping Connection Open - Consequences?
      I have an application where I need to keep the connection open because my application monitors 2 separate databases ever 1 second. Is there a...
    4. Timing out connections in Open Transport
      Hi, I'm using Open Transport TCP/IP to implement a database server in OS 9. (I'm working on carbonizing it for OS X). It all works OK except...
    5. tidy connections left open
      Many a page has ADO Connection objects that were opened but never closed. The Connection object allocates its own resources when it is opened. ...
  3. #2

    Default Re: Keeping connections open

    It's generally considered good practice to get in & get out as quickly as
    possible. This means you should open your connection at the last moment, do
    your stuff, then rest the connection as quickly as possible.

    Given this, your solution is the right way (providing you ARE closing the
    connect afterwards(?)).

    If you use the same connection string each time, it will keep using the same
    pooled connection, which is another good practice to adopt.

    So in answer to your question... this IS the neat way...

    Chris

    "aidanh" <anonymous@discussions.microsoft.com> wrote in message
    news:904C39DB-D8E0-47B9-B314-4963116BB55A@microsoft.com...
    > I am very new to asp, and I am wondering what is the best way to get
    around a this problem:
    >
    > I use asp to give me a status on a database which is changing frequently.
    I open a connection to the database at the begining of the the script, and
    then execute a command to obtain a recordset.
    >
    > If I want the information in the asp page to be constantly up to date, the
    only way I can see to do this is to refresh the page at intervals, which
    opens the database again, and executes command again.
    >
    > Is there a neater way to do this? Or is this the only way?
    >
    > aidanh

    CJM Guest

  4. #3

    Default Re: Keeping connections open

    aidanh wrote:
    > I am very new to asp, and I am wondering what is the best way to get
    > around a this problem:
    >
    > I use asp to give me a status on a database which is changing
    > frequently. I open a connection to the database at the begining of
    > the the script, and then execute a command to obtain a recordset.
    >
    > If I want the information in the asp page to be constantly up to
    > date, the only way I can see to do this is to refresh the page at
    > intervals, which opens the database again, and executes command
    > again.
    >
    > Is there a neater way to do this? Or is this the only way?
    >
    > aidanh
    If you have no client-side code restirctions, then you can use XMLHTTP to do
    this without refreshing the page. Please follow-up in a client-side coding
    newsgroup (one of the scripting groups, or one of the groups with "dhtml" in
    their names) if you wish to pursue this option.

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139