Re: "General Network Error" and Connection Pooling



Of course. This is a known issue that was fixed with 2.0. When you use
connection pooling, the pool is filled with identical connections that
remain live after your code executes Close. When the server fails these
"open" connections are invalidated, but ADO 1.1 does nothing about it--until
you try to use one. At that point you'll get an exception and the offending
connection is cleared but any remaining (identical) connections are not.
This means when you try again, you'll get another exception and you'll keep
getting exceptions until the pool is cleared. This might mean 2-20 or up to
100 retries. It might be faster to restart your application (in 1.1) as
there is no other way to empty the pool except to wait for them to time out
(4-8 minutes).

In ADO.NET 2.0 the pooling mechanism has been repaired in that as soon as it
determines that a connection is bad, it flushes the pool--knowing that they
are all bad.

I'll be talking about these issues in Cleveland and Eau Claire (Wisconsin)
in early November and in Sydney at VSLive.

hth

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


"Jeppe Jespersen" <jdj@xxxxxxxxxxxxxxxx> wrote in message
news:e5d%23td72FHA.3704@xxxxxxxxxxxxxxxxxxxxxxx
>I have a very simple WinForms app, that uses a sqlDataAdapter retrieve data
>into a dataset.
> The dataset is set to be the datasource of a DataGrid. If - while editing
> rows in my grid - i lose my network connection (or stop + start my
> sqlserver), i get a "General Network Error" when I call my dataAdapters
> .update method. (...naturally, after reestablishing network connection,
> that is...)
>
> However, if i disable connection pooling, I get no error. Also, with
> connection pooling enabled, if I repeatedly call update, eventually it
> succeeds on the third attempt.
>
> Anyone who can smarten me up?
>
> J. Jespersen
> Denmark
>
>


.



Relevant Pages

  • Re: Connection Pool Issue
    ... Max pool size 10 seems low... ... My first thought would be that connection poolling is actually disabled on A ... Server A and Server B both are running Windows 2000 Server sp4, ... all the usual places for enabling connection pooling. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: ado connection object in vb6
    ... "Global connection objects are bad in so many ways. ... The key is that ADO uses 'connection pooling'. ... "Pooling in the Microsoft Data Access Components" ...
    (microsoft.public.vb.database.ado)
  • Re: connection pooling
    ... the architecture that determines whether you need connection pooling. ... it's often suggested that you build a separate pool for each ... >>> A web server has a finite capacity. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: pooled connection myth
    ... Each time a connection is closed it is gone. ... You are making a rather large assumption: that the connection object you ... obtain from the pool is an instance provided by the driver you ... This is connection pooling. ...
    (comp.lang.java.programmer)
  • Re: connection pools yay or nay
    ... Connection pooling == goodThingToDo; ... As far as the size of the pool, ... > How does everyone feel about the use of Connection pools within a web ... minor performance tuning on the SQL box itself... ...
    (microsoft.public.dotnet.framework.adonet)