Re: What is the difference between Dispose and Close
- From: "William \(Bill\) Vaughn" <billvaNoSpam@xxxxxxxxx>
- Date: Wed, 8 Jun 2005 13:27:05 -0700
Sourcery? Dispose and Close both return the connection to the pool. If they
were calling neither or the logic let the PSP sneak away without calling one
or the other, adding Dispose would do the trick--assuming it's actually
called. I've seen lots of cases where developers pass a DataReader to
another routine that fails to close the DataReader (assuming they remembered
to use the correct CommandBehavior). I've seen situations where the Close
(or Dispose) is there, but the logic bypasses it if there is an exception
(the Close is not in the Finally).
Unless it's a bug (which I doubt), I don't expect that Dispose will cure any
more connection pool issues than Close. Is there a code example somewhere
that shows that Dispose works where Close does not? If so, I know a number
of folks on campus that would love to see it.
--
____________________________________
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.
__________________________________
"Cor Ligthert" <notmyfirstname@xxxxxxxxx> wrote in message
news:uH3U2KFbFHA.3132@xxxxxxxxxxxxxxxxxxxxxxx
> Bill,
>
>> As far as pooling behavior, Dispose and Close both return the Connection
>> to the pool for reuse. Each of the .NET providers implements a Connection
>> pool--it's part of the core functionality.
>>
> Why were there than so many people in these newsgroup, who had problems
> with the Connection Pool, for whom, after that I advised to change the
> close for dispose (according to the messages from Angel), the Connection
> pool problems were gone?
>
> Cor
>
.
- Follow-Ups:
- Re: What is the difference between Dispose and Close
- From: Cor Ligthert
- Re: What is the difference between Dispose and Close
- From: Sahil Malik [MVP]
- Re: What is the difference between Dispose and Close
- References:
- What is the difference between Dispose and Close
- From: ad
- Re: What is the difference between Dispose and Close
- From: William \(Bill\) Vaughn
- Re: What is the difference between Dispose and Close
- From: Cor Ligthert
- Re: What is the difference between Dispose and Close
- From: William \(Bill\) Vaughn
- Re: What is the difference between Dispose and Close
- From: Cor Ligthert
- What is the difference between Dispose and Close
- Prev by Date: Re: ADO.NET 2.0 ExecutePageRader
- Next by Date: Re: Attaching Combobox to a Column in ADO .NET (with MS Access)
- Previous by thread: Re: What is the difference between Dispose and Close
- Next by thread: Re: What is the difference between Dispose and Close
- Index(es):
Relevant Pages
|