Re: What is the difference between Dispose and Close
- From: "Sahil Malik [MVP]" <contactmethrumyblog@xxxxxxxxxx>
- Date: Wed, 8 Jun 2005 17:36:39 -0400
Regards connection pooling, I doubt there is a differnce between dispose and
close. All you have to do is look at the reflected code, dispose calls
close - KAPUT !! (and does a little bit more which has nothing to do with
pooling).
- Sahil Malik [MVP]
Upcoming ADO.NET 2.0 book - http://tinyurl.com/9bync
----------------------------------------------------------------------------
---------------
"William (Bill) Vaughn" <billvaNoSpam@xxxxxxxxx> wrote in message
news:ewH0whGbFHA.2416@xxxxxxxxxxxxxxxxxxxxxxx
> 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: William \(Bill\) Vaughn
- 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
- Re: What is the difference between Dispose and Close
- From: William \(Bill\) Vaughn
- What is the difference between Dispose and Close
- Prev by Date: Re: Returning data from updated table with VB transactions
- Next by Date: Re: Databinding ComboBox Slow
- 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
|