Re: ADO.NET and Sleeping processes

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: William \(Bill\) Vaughn (billvaRemoveThis_at_nwlink.com)
Date: 02/01/05


Date: Tue, 1 Feb 2005 12:23:19 -0800

Take a gander at my article on connection pooling. The server connections
are NOT closed when the pooled connection is closed--it takes 4-8 minutes
for these to die of old age and be closed. See www.betav.com/articles.htm

-- 
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
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.
__________________________________
"AMerrell" <anonymous@msnews.microsoft.com> wrote in message 
news:%23%23tTlnJCFHA.936@TK2MSFTNGP12.phx.gbl...
> Yeah, The reason I'm wanting to keep polled conections is because of this 
> statement: "Pooling connections can significantly enhance the performance 
> and scalability of your application." My problem is that even when I close 
> the connection it doesn't seem to be releaseing it back to the pool.
>
> My understanding is as long as the connection string doesn't change it 
> should take the next available pooled connection.  Instead what it's doing 
> is just creating another pooled connection and sleeping.  I eventually hit 
> the max pool size and all applications stop responding.
>
> What I'm trying to figure out is why my connection is not being release 
> back to the pool.  Correct me if I'm wrong but I do believe my code does 
> close the connection.
>
>
>>>> Patrice<nobody@nowhere.com> 2/1/2005 12:12:20 PM >>>
> What you see is likely the pooling feature :
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconconnectionpoolingforsqlservernetdataprovider.asp
>
> Adding "pooling=false" in your connection string should disable pooling...
>
> Patrice
>
> -- 
>
> "amerrell" <anonymous@msnews.microsoft.com> a écrit dans le message de
> news:eU1yQdICFHA.2072@TK2MSFTNGP10.phx.gbl...
>> How can I prevent the flood of sleeping processes that occur from my
> database queries using datareaders?
>>
>> Here is how I make my connections am I doing somehting wrong?
>>
>>
>> Dim myConnection As New SqlConnection(GetAppSetting("DBCon"))
>> Dim myCommand As New SqlCommand("Select * from table where column =
> @column", myConnection)
>> myCommand.Parameters.Add("@column", columnvalue)
>>
>> Try
>>    Dim dr As SqlDataReader
>>    myConnection.Open()
>>    dr = myCommand.ExecuteReader()
>>    While dr.read()
>>       strVar = dr("somecolumn")
>>    end while
>>    dr.close()
>>    myconnection.close()
>> Catch ex as Exception
>>    Trace.Write("SQLQuery ", ex.Message)
>> End Try
>>
>>
>> Thanks for any help...
>>
>> amerrell
>
>
>
> 


Relevant Pages

  • Re: ODBC/OLE DB Connection Pool
    ... > Connection Pool (I have already completed the TCP/IP tasks without ... turning off pooling is the errors you are seeing. ... problems are occurring with SQL Server; for example, ... ASP developers should open one connection per set of unique user ...
    (microsoft.public.data.ado)
  • Re: ODBC/OLE DB Connection Pool
    ... > Connection Pool (I have already completed the TCP/IP tasks without ... turning off pooling is the errors you are seeing. ... problems are occurring with SQL Server; for example, ... ASP developers should open one connection per set of unique user ...
    (microsoft.public.inetserver.asp.db)
  • Re: ODBC/OLE DB Connection Pool
    ... > Connection Pool (I have already completed the TCP/IP tasks without ... turning off pooling is the errors you are seeing. ... problems are occurring with SQL Server; for example, ... ASP developers should open one connection per set of unique user ...
    (microsoft.public.data.oledb)
  • Re: Question about IDispose
    ... > SqlConnection.Close() if the connection is not already closed. ... > handles pooling just fine does). ... >to write a Dispose method that works properly with the pooling system ... >> are cheap, however, the reverse is true in a web environment. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ODBC/OLE DB Connection Pool
    ... > And if there is no global ADODB.Connection, there will be no pooling. ... The ADO Connection object implicitly uses IDataInitialize. ...
    (microsoft.public.inetserver.asp.db)