Re: SqlConnection and connection pooling

Discussion in 'ASP .Net' started by William \(Bill\) Vaughn, Nov 14, 2003.

  1. I suspect that your code is orphaning connections. We've seen some _very_
    heavily used ASP sites get away with 10 connections. If you discover that
    your ASP pages are not closing the connections in time (while they are in
    scope), the connections might be orphaned and left in the pool indefinitely.
    The Connection Lifetime is used in clustering servers and won't have much
    effect on how long connections are left in the pool. It's not possible to
    "clear out" the pool with the current version of the .NET Data Providers.
    The code shown in the other message will clear out "damaged" or "broken"
    connections that are no longer viable. The Whidbey release has extra methods
    to manage the pool and clear it out, but this is only a patch to make up for
    an error in your coding. It should not be necessary. Go through your code
    and make sure that the connections are explicitly closed. If you're using
    DataReaders, these are especially prone to this behavior as you're expected
    to manage the connections yourself.

    hth

    --
    ____________________________________
    William (Bill) Vaughn
    Author, Mentor, Consultant
    MVP, hRD
    www.betav.com
    Please reply only to the newsgroup so that others can benefit.
    This posting is provided "AS IS" with no warranties, and confers no rights.
    __________________________________

    "Jacob Anderson" <> wrote in message
    news:003301c3aa01$bbb079e0$...
    > Hello!
    >
    > I have a high-traffic ASP.NET application which is
    > experiencing some problems with the connection pool in
    > ASP.NET.
    >
    > We have found that if we set the pool size to 50, we
    > still need to explicitly set a small connection lifetime,
    > e.g. 60 seconds, to allow the site to run correctly. If
    > we do not explicitly kill connections, the site
    > experiences errors that are likely memory related (no
    > exception from Server.GetLastError()).
    >
    > Does anyone have some information or insight on the
    > connection pooling with ASP.NET? Such as if there is a
    > known memory leak with the SqlConnection object? Our
    > code always closes all of its connections via:
    >
    > try {
    > con= new SqlConnection(...);
    > }
    > finally {
    > con.Close();
    > }
    >
    > Thanks!
    >
    > -- Jake
    >
     
    William \(Bill\) Vaughn, Nov 14, 2003
    #1
    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. Edward W.
    Replies:
    5
    Views:
    3,292
    =?Utf-8?B?SEFSSSBQUkFTRCBCQVJV?=
    Dec 15, 2004
  2. Rob Nicholson

    ADO.NET, connection pooling and ASP.NET

    Rob Nicholson, Aug 31, 2005, in forum: ASP .Net
    Replies:
    18
    Views:
    4,496
    Rob Nicholson
    Sep 17, 2005
  3. Raj
    Replies:
    1
    Views:
    413
    Adam Maass
    Aug 25, 2003
  4. Justin M
    Replies:
    0
    Views:
    429
    Justin M
    Dec 8, 2003
  5. Baba
    Replies:
    3
    Views:
    4,504
Loading...

Share This Page