Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IDisposable Mysteries
Message
From
15/04/2011 10:50:57
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Vista
Network:
Windows XP
Database:
Jet/Access Engine
Application:
Desktop
Miscellaneous
Thread ID:
01506168
Message ID:
01507483
Views:
48
>>I wouldn't say "preferrable", I'd say "interchangeable".
>
>Internally Dispose() calls Close() but not vice versa. OTOH since the clean-up occurs in the Close() method I guess they could regarded as interchangeable.
>MS also says that both options will return the connection to the pool (if pooling is enabled) - but here I'm a little confused. I've read that Dispose(), unlike Close(), will clear the connection string. If that is true and it is also returned to the pool I don't see how it will ever be re-used since it won't match any subsequent request for a connection.
>
>Maybe what I read about the connection string being cleared was wrong - I haven't verified it ......


I've also read conflicting information about what I bolded above, so I'm not sure which is actually correct either. But, the docs *do* say that both Close() and Dispose() return the connection to the Pool ... but documentation can be wrong. I wish I knew for sure ...

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform