Re: Close and Dispose argument

From: William \(Bill\) Vaughn (billvaRemoveThis_at_nwlink.com)
Date: 03/16/05


Date: Wed, 16 Mar 2005 12:59:42 -0800

This doc bug was reported years ago and fixed AFAIK--however, once it's
printed, it's hard to go out to each page and fix it. I mentioned the issue
in my ADO.NET book as well. It's been discussed here many times.

In ADO.NET 1.0 and 1.1 there is no way short of stopping your application to
manually clear the connection pool. ADO.NET 2.0 supports this functionality.

-- 
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
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.
__________________________________
"Infinite_Recursion" <icer88881@gmail.com> wrote in message 
news:ul37namKFHA.3076@tk2msftngp13.phx.gbl...
> This is something that I descovered is not only an issue with me, since 
> there has been so many posts on the issue. The real problem resides in the 
> fact that even Microsoft is not clear on the issue.
> Long story short, here is an email conversation between me and Microsoft 
> that explains it...
> ---------
>
>
> From: Microsoft Learning Contact Us <learning@css.one.microsoft.com>
> To: icer88881@gmail.com
> Date: Thu, 3 Mar 2005 18:40:06 -0800
> Subject: CST187877936ID - RE:Microsoft.Com ContactUS
>
> Hello,
>
> This is Grace of Microsoft Learning Customer Support. Your e-mail has been 
> transferred to us for proper handling
> of your issue and we're truly sorry for not responding sooner with your 
> concern
>
> I understand that you're reporting a documentation on the book "Microsoft 
> Official Course 2389B Programming with
> Microsoft ADO.NET" module 2, page 18. We apologize for the inconvenience 
> this may have caused you.
>
> I am currently working with my colleagues to investigate this issue. As 
> soon as one of my resources replies, I will
> forward the information to you.
>
> Thank you for bearing with us while we work to resolve your issue. If you 
> require other assistance, please do not
> hesitate to write back.
>
> Sincerely,
>
> Grace
> Microsoft Learning Customer Support
>
> --- Original Message --- 
> From: icer88881@gmail.com
> To: msdn@css.one.microsoft.com
> Sent: Wed Mar 2 07:32:27 PST 2005
> Subject: Microsoft.Com ContactUS
>
>
> URL:http://msdn.microsoft.com/
> DOM:msdnw
> LANG:English (United States)
> LOC:LB
> BR:windows nt 5.1/mozilla/5.0 (windows; u; windows nt 
> 5.1;/en-us,en;qSubject: Close() and Dispose() with connection pooling
> Comment: This is a chaotic issue since in MSDN itself there are 
> contradictions. Weather SqlConnection.Dispose() returns or removes the 
> connections from the pool is still a debate. I have come to a conclusion 
> that it returns it to the pool after massive research and experimentation, 
> and after monitoring pooled connections in SQL server. The mistake I am 
> trying to report is in your book "Microsoft Official Course 2389B 
> Programming with Microsoft ADO.NET" module 2, p 18: "Calling the Dispose 
> method removes the conneciton from the connection pool". The thing is if 
> we cannot trust your books then what good is your documentation anyway, 
> and why should I pay your partners for training. I hope I recieve an 
> answer on the issue...
> Site Bugs: in the book
>
>
>
>
> From: Microsoft Courseware Support <support@mscourseware.com>
> To: icer88881@gmail.com
> Date: Fri, 4 Mar 2005 16:23:01 -0800
> Subject: FW: CST187877936ID - RE:Microsoft.Com ContactUS
>
>
> Hello,
>
>
>
> Your issue was forwarded to us here at Microsoft Courseware Support.  The 
> discrepancy you describe has been previously reported.  When such errors 
> are reported, the Courseware Support team formats and submits an error log 
> revision for review. The revisions that are accepted by a Subject Matter 
> Expert (SME) are then posted to the MCT Download Center.  It is the 
> Trainer's responsibility to download these documents prior to delivery of 
> a course and share the information with their students.
>
>
>
> Module 2, page 17 currently states: "When you close a connection, the flow 
> to and from the data source closes, but unmanaged resources used by the 
> connection object have not been released. If connection pooling is 
> enabled, the connection is released to the pool. Both the SqlConnection 
> object and the OleDbConnection object have a Dispose method to release the 
> unmanaged resources. Calling the Dispose method marks the connection for 
> deletion from the connection pool."   Add to this statement: "An internal 
> process periodically examines each pool and destroys unused resources."
>
>
>
> Also, Module 2, page 39, second paragraph, 2nd and 3rd sentences currently 
> state: "When a connection is disposed, the connection is deleted from 
> memory. It is not returned to the pool and is not available for reuse. 
> When the last connection in a connection pool is deleted, the pool is also 
> deleted from memory."  These statements are incorrect and should be 
> ignored. When a SqlConnection object is disposed the underlying connection 
> to the database is still kept in the connection pool and can be used by 
> other SqlConnection objects.
>
>
>
> We apologize for any inconvenience this may have caused you.
>
>
>
> Best regards,
>
>
>
> Bob
>
> Technical Support Specialist
>
> Microsoft Courseware Support
>
> support@mscourseware.com
>
>
>
> --- Original Message --- 
> From: icer88881@gmail.com
> To: msdn@css.one.microsoft.com
> Sent: Wed Mar 2 07:32:27 PST 2005
> Subject: Microsoft.Com ContactUS
>
>
> URL:http://msdn.microsoft.com/
> DOM:msdnw
> LANG:English (United States)
> LOC:LB
> BR:windows nt 5.1/mozilla/5.0 (windows; u; windows nt 
> 5.1;/en-us,en;qSubject: Close() and Dispose() with connection pooling
> Comment: This is a chaotic issue since in MSDN itself there are 
> contradictions. Weather SqlConnection.Dispose() returns or removes the 
> connections from the pool is still a debate. I have come to a conclusion 
> that it returns it to the pool after massive research and experimentation, 
> and after monitoring pooled connections in SQL server. The mistake I am 
> trying to report is in your book "Microsoft Official Course 2389B 
> Programming with Microsoft ADO.NET" module 2, p 18: "Calling the Dispose 
> method removes the conneciton from the connection pool". The thing is if 
> we cannot trust your books then what good is your documentation anyway, 
> and why should I pay your partners for training. I hope I recieve an 
> answer on the issue...
> Site Bugs: in the book
>
>
>
>
>
>
>
> From: Microsoft Learning Contact Us <learning@css.one.microsoft.com>
> To: icer88881@gmail.com
> Date: Fri, 4 Mar 2005 20:30:18 -0800
> Subject: RE:CST187877936ID - RE:Microsoft.Com ContactUS
>
> Hello,
>
> Your e-mail has been escalated to the next tier of support.
>
> A representative will follow up with you directly.
>
> Thank you again for bearing with us while we work to resolve
> your issue. Please let us know if you have other concerns.
>
> Sincerely,
>
> Grace
> Microsoft Learning Customer Support
>
> --- Original Message --- 
> From: learning@css.one.microsoft.com
> To: icer88881@gmail.com
> Sent: Thu Mar 3 18:38:19 PST 2005
> Subject: CST187877936ID - RE:Microsoft.Com ContactUS
>
>
> Hello,
>
> This is Grace of Microsoft Learning Customer Support. Your e-mail has been 
> transferred to us for proper handling
> of your issue and we're truly sorry for not responding sooner with your 
> concern
>
> I understand that you're reporting a documentation on the book "Microsoft 
> Official Course 2389B Programming with
> Microsoft ADO.NET" module 2, page 18. We apologize for the inconvenience 
> this may have caused you.
>
> I am currently working with my colleagues to investigate this issue. As 
> soon as one of my resources replies, I will
> forward the information to you.
>
> Thank you for bearing with us while we work to resolve your issue. If you 
> require other assistance, please do not
> hesitate to write back.
>
> Sincerely,
>
> Grace
> Microsoft Learning Customer Support
>
>
>
> From: icer88881 <icer88881@gmail.com>
> Reply-To: icer88881 <icer88881@gmail.com>
> To: Microsoft Learning Contact Us <learning@css.one.microsoft.com>
> Date: Sat, 5 Mar 2005 09:52:32 +0200
> Subject: Re: CST187877936ID - RE:Microsoft.Com ContactUS
>
> Hello Sir, and thank you for the reply.
> Your reply only adds confusion to my list of blurr facts in .NET
> documentation. You stated "An internal process periodically examines
> each pool and destroys unused resources.", and then you stated: "When
> a SqlConnection object is disposed the underlying connection to the
> database is still kept in the connection pool...", to me I sencerly
> think the 2 statements without any further explanation kind of
> contradict, since first you are saying that the connection is
> eventually removed from the pool and in the second you say that it
> stays...???
> My other concern is that, you stated: "It is the Trainer's
> responsibility to download these documents prior to delivery of a
> course and share the information with their students."
> So what if the trainer did not, and even after discussing the issue
> with him many times he insisted on what was in the text, leaving no
> chance for an honest mistake. I am currently learning at a very know
> institute: "New Horizons Lebanon", they are supposed to be something
> like "Gold Partners". My question is do they diserve to be so, or is
> it just about who is paying Microsoft more for being a partner????
> This issue is not the only one, this is just the top of the iceburg. I
> truely hope for the best interest of Microsoft itself that this issue
> be resolved n the proper manner, and I hope for supervision of such
> institutes to be more stric _that is if there is any supervision at
> all_ only  if Microsoft CARES...
> thanks...
>
>
>
>
> Finally they tell me this:<------------
>
>
>
> From: Microsoft Courseware Support <support@mscourseware.com>
> To: icer88881@gmail.com
> Date: Tue, 15 Mar 2005 11:11:24 -0800
> Subject: RE: RE:RE: CST187877936ID - RE:Microsoft.Com ContactUS
>
>
>
>
> Hello Icer88881,
>
>
>
> The development teams for Microsoft Courseware strive to make the 
> courseware accurate.  Occasionally errors do slip into the printed 
> manuals.  We have a mechanism for providing error updates to our certified 
> trainers so that they may pass corrections on to the student in the 
> course.  We have noted the error that has caused you distress and will 
> make sure that the replacement for 2389B on Visual Studio 2005 does not 
> have this error in it.  We appreciate and encourage you to report such 
> errors to us.
>
>
>
> On their own, the corrections previously provided do appear to be 
> contradictory, but if considered within the context of where they are 
> presented in the module, there are no contradictions.  Please review the 
> courseware materials in their entirety while keeping in mind the 
> corrections previously provided.  If you continue to have questions or 
> concerns regarding this information, we would recommend that you discuss 
> this with your Trainer or seek peer support through newsgroups such as 
> news://msnews.microsoft.com/microsoft.public.dotnet.xml or 
> news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet.
>
>
> Best regards,
>
>
>
> Bob
>
> Technical Support Specialist
>
> Microsoft Courseware Support
>
> support@mscourseware.com
>
>
> --- Original Message --- 
> From: icer88881@gmail.com
> To: learning@css.one.microsoft.com
> Sent: Sat Mar 5 00:00:51 PST 2005
> Subject: Re: CST187877936ID - RE:Microsoft.Com ContactUS
>
> Hello Sir, and thank you for the reply.
> Your reply only adds confusion to my list of blurr facts in .NET
> documentation. You stated "An internal process periodically examines
> each pool and destroys unused resources.", and then you stated: "When
> a SqlConnection object is disposed the underlying connection to the
> database is still kept in the connection pool...", to me I sencerly
> think the 2 statements without any further explanation kind of
> contradict, since first you are saying that the connection is
> eventually removed from the pool and in the second you say that it
> stays...???
> My other concern is that, you stated: "It is the Trainer's
> responsibility to download these documents prior to delivery of a
> course and share the information with their students."
> So what if the trainer did not, and even after discussing the issue
> with him many times he insisted on what was in the text, leaving no
> chance for an honest mistake. I am currently learning at a very know
> institute: "New Horizons Lebanon", they are supposed to be something
> like "Gold Partners". My question is do they diserve to be so, or is
> it just about who is paying Microsoft more for being a partner????
> This issue is not the only one, this is just the top of the iceburg. I
> truely hope for the best interest of Microsoft itself that this issue
> be resolved n the proper manner, and I hope for supervision of such
> institutes to be more stric _that is if there is any supervision at
> all_ only if Microsoft CARES...
> thanks...
>
> --- Original Message --- 
> From: icer88881@gmail.com
> To: msdn@css.one.microsoft.com
> Sent: Wed Mar 2 07:32:27 PST 2005
> Subject: Microsoft.Com ContactUS
>
>
> URL:http://msdn.microsoft.com/
> DOM:msdnw
> LANG:English (United States)
> LOC:LB
> BR:windows nt 5.1/mozilla/5.0 (windows; u; windows nt
> 5.1;/en-us,en;qSubject: Close() and Dispose() with connection pooling
> Comment: This is a chaotic issue since in MSDN itself there are
> contradictions. Weather SqlConnection.Dispose() returns or removes the
> connections from the pool is still a debate. I have come to a conclusion
> that it returns it to the pool after massive research and
> experimentation, and after monitoring pooled connections in SQL server.
> The mistake I am trying to report is in your book "Microsoft Official
> Course 2389B Programming with Microsoft ADO.NET" module 2, p 18:
> "Calling the Dispose method removes the conneciton from the connection
> pool". The thing is if we cannot trust your books then what good is your
> documentation anyway, and why should I pay your partners for training. I
> hope I recieve an answer on the issue...
> Site Bugs: in the book
>
> -------------------------
>
> So if any one has clues I will be happy to read them
>
> -----------------------
>
>
>
>
> 


Relevant Pages

  • Close and Dispose argument
    ... here is an email conversation between me and Microsoft ... connections from the pool is still a debate. ... Programming with Microsoft ADO.NET" module 2, p 18: "Calling the Dispose ... method removes the conneciton from the connection pool". ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Close and Dispose argument
    ... you can keep your connection from using Connection Pooling in the first ... the connection won't use the pool. ... >> the fact that even Microsoft is not clear on the issue. ... >> Your issue was forwarded to us here at Microsoft Courseware Support. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: VPN disconnection
    ... The connection still hangs/disconnects, ... subject with subject: VPN disconnection. ... Microsoft CSS Online Newsgroup Support ... if you installed SP2 on the SBS server without ...
    (microsoft.public.windows.server.sbs)
  • RE: client computer loses connection to server everynight
    ... Since you upgrade the hardware on the client computer, ... As you mentioned "the machine loses the connection to the server". ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)
  • RE: Switching to ADSL over USB connection from ethernet
    ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ... Switching to ADSL over USB connection from ethernet ...
    (microsoft.public.windows.server.sbs)