Re: "General Network Error" and Connection Pooling
- From: "William \(Bill\) Vaughn" <billvaNoSpam@xxxxxxxxx>
- Date: Fri, 28 Oct 2005 10:16:52 -0700
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
>
>
.
- Prev by Date: no primary key on union query
- Next by Date: Re: Dataset with large tables
- Previous by thread: Re: "General Network Error" and Connection Pooling
- Next by thread: Re: "General Network Error" and Connection Pooling
- Index(es):
Relevant Pages
|