Re: Question about Connection Pooling in ASP

From: Bob Barrows [MVP] (reb01501_at_NOyahoo.SPAMcom)
Date: 01/22/05

  • Next message: Jake: "Re: Set password on database"
    Date: Sat, 22 Jan 2005 13:48:46 -0500
    
    

    Dr. Know wrote:
    > I have completed an Web App that accesses numerous databases and want
    > to ensure that connection pooling is being fully utilized

    In ASP, you almost have to deliberately turn off connection pooling in order
    not to use it. It's on by default. However, there are some considerations
    that you need to be aware of:

    Here are some articles that provide some background:
    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

    connection failures caused by pooling disablement
    http://support.microsoft.com/default.aspx?scid=kb;en-us;328476

    ******implicit connections:
    http://support.microsoft.com/?kbid=271128

    > Will static connection string definitions declared as constants in the
    > head of the ASP page itself work?

    Doesn't matter

    > Avoiding Server.CreateObject?

    Using Server.CreateObject causes MTS to be used, which maintains its own
    separate pool of connections. However, in IIS5 and above it's no longer
    necessary to use it, and avoiding its use will improve performance. But
    again, it's not really relevant to session pooling which is on by default in
    ASP.

    > Const PROVIDER = "Provider=vfpoledb;Data Source=C:\DBFILESLOC\"
    > ' ( Or should this be stored in an application variable?? )

    As long as you are talking about storing a string in Application, then
    there's no reason not to. Using a global string will help you ensure that
    pooling is used for all connections using that string.

    Do not store ADO objects in Application or Session: they are not
    free-threaded by default.
    http://www.aspfaq.com/2053

    > set objConn = Createobject("ADODB.Connection")
    > objConn.ConnectionString = PROVIDER
    > objConn.Open ' PROVIDER <-- is it preferable to use here??

    Irrelevant. There is no difference to either way of doing it.

    > Do some recordset stuff....

    Basically, as long as you close connections as soon as you are finished with
    them, releasing them to the session pool, you will be taking full advantage
    of pooling. If you do things to prolong connections, such as recordset loops
    using connected recordsets, instead of utilizing GetString, GetRows
    (http://www.aspfaq.com/show.asp?id=2467) or disconnected recordsets, you
    will not get the full benefit from pooling, even though it is still turned
    on.

    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" 
    

  • Next message: Jake: "Re: Set password on database"

    Relevant Pages

    • Re: How to close connection pool?
      ... Simply open connections with pooling disabled--or as suggested when ... Microsoft MVP ... pool preventing it until the user exits the application. ... so I need to set pooling to false for that action. ...
      (microsoft.public.dotnet.framework.adonet)
    • RE: How should I connect via DBD::Oracle to efficiently obtain 2000+ simultaneous connections?
      ... Here are a few options off the top of my head: ... Pooling via SQLRelay ... connections, just reduces the number of connections required. ... to take some load off of your database server. ...
      (perl.dbi.users)
    • Re: ADO - Bad when it is time to Optimize
      ... in COM-ATL and the data access is thru ADO to SQL. ... You cannot set the max pool size. ... There is no way to disable the pooling ... You cannot know whether non-pooled connections are happening ...
      (microsoft.public.data.ado)
    • Re: Disable .Net Connection Pooling thru SQLDMO
      ... -- -oj "Rob Kraft" wrote in message ... >I would like to disable the .Net connection Pooling. ... I have a conversion> pgm using SQLDMO and .Net that needs to kill its own connections, ...
      (microsoft.public.sqlserver.programming)
    • Re: Global data concurrent access ?
      ... No pooling 1000 iterations. ... Elapsed time: 00:00:12.9217096 ... affects pooled connections (makes sense; ...
      (microsoft.public.dotnet.framework)