How to using connection pool technlogy in ASP

Discussion in 'ASP General' started by Utada P.W. SIU, Dec 11, 2004.

  1. Thanks~~
    Utada P.W. SIU, Dec 11, 2004
    #1
    1. Advertising

  2. "Utada P.W. SIU" <> wrote in message
    news:...
    > Thanks~~
    >
    >


    The magical thing isn't it? If you can pool, your app will rock :)
    ASP itself, does not use pooling. Only COM+ components written using C++ or
    a .NET language ca be pooled. Note that pooling should not be a -target- but
    a solution, if you really need it for specifici reasons. eg:
    1) you need to cache specific data.
    2) you have a specific driver that does -not- support database resource
    pooling (ado does support!).
    3) etc

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncomser/html/scalobjpool.asp

    --
    compatible web farm Session replacement for Asp and Asp.Net
    http://www.nieropwebconsult.nl/asp_session_manager.htm
    Egbert Nierop \(MVP for IIS\), Dec 11, 2004
    #2
    1. Advertising

  3. Utada P.W. SIU wrote:
    > Thanks~~


    You should be asking how NOT to use connection pooling. In ASP, connection
    pooling is used automatically, without the developer having to do a thing.

    Now, mind you, there are things a developer can do to disable connection
    pooling, such as:

    - failure to use an explicit connection object to open recordsets or execute
    commands. This syntax:

    set cn=createobject("adodb.connection")
    cn.open <some connection string>
    set rs=createobject("adodb.recordset")
    rs.Source=<some query string>
    rs.ActiveConnection = cn
    rs.Open

    will cause a second connection, using the connection string from cn, to be
    opened and used to open rs. To prevent that, you must use the Set keyword:

    Set rs.ActiveConnection = cn
    See http://support.microsoft.com/?kbid=271128

    - use of the OLE DB Services attribute in your connection string to disable
    pooling

    - failure to close and destroy connections when you are finished with them

    Here is some more information:
    http://msdn.microsoft.com/library/en-us/dnmdac/html/pooling2.asp
    http://support.microsoft.com/?scid=kb;en-us;Q176056
    http://support.microsoft.com/default.aspx?scid=kb;en-us;191572
    http://support.microsoft.com/default.aspx?scid=kb;en-us;324686

    Bob Barrows

    --
    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], Dec 11, 2004
    #3
  4. Bob Barrows [MVP] wrote:
    > rs.ActiveConnection = cn
    >
    > ...will cause a second connection, using the connection
    > string from cn, to be opened and used to open rs. To
    > prevent that, you must use the Set keyword:
    >
    > Set rs.ActiveConnection = cn


    Or use JScript, as the above is the only possible syntax for assigning the
    ActiveConnection property in JScript.



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
    Dave Anderson, Dec 12, 2004
    #4
    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. Linus Nikander
    Replies:
    5
    Views:
    529
  2. _XaToA_
    Replies:
    0
    Views:
    2,199
    _XaToA_
    Oct 30, 2003
  3. =?Utf-8?B?Sm9lU2Vw?=
    Replies:
    2
    Views:
    1,463
    =?Utf-8?B?Sm9lU2Vw?=
    Oct 9, 2006
  4. Wei  Lu
    Replies:
    2
    Views:
    5,841
    Wei Lu
    Feb 16, 2009
  5. Rick Lawson
    Replies:
    8
    Views:
    786
    Graham Dumpleton
    Jul 17, 2009
Loading...

Share This Page