惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
H
Help Net Security
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
量子位
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
Scott Helme
Scott Helme
The Last Watchdog
The Last Watchdog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
AI
AI
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
Google Online Security Blog
Google Online Security Blog
U
Unit 42
V2EX - 技术
V2EX - 技术
MongoDB | Blog
MongoDB | Blog
Schneier on Security
Schneier on Security
博客园 - Franky
H
Heimdal Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Cloudbric
Cloudbric
B
Blog RSS Feed
N
News | PayPal Newsroom
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
雷峰网
雷峰网

博客园 - Heclei

WebDeploy 同步IIS6 bindingRedirect 相当奇怪的设置 - Heclei - 博客园 C# 使用WM_NCLBUTTONDOWN消息实现任意位置移动窗体 发布开源程序:数据库结构比较 VS2005 WEB F5调试自动退出调试状态 JS整理,getCookie, getElementsByClassName , 添加删除事件 (转)C# 单实例 - Heclei - 博客园 (转)VC++ 2005 用程式建立 Paradox ( *.db ) 资料库档桉 - Heclei C# 判断操作系统类型 Service Broker实现发布-订阅(Publish-Subscribe)框架(3) Service Broker实现发布-订阅(Publish-Subscribe)框架(2) Service Broker实现发布-订阅(Publish-Subscribe)框架(1) mysql ERROR 1045 JS实现局部打印和预览 perforce,P4,权限设置 Visual Studio 2005 sp1 新愁加就恨 将一个数据库的登录账户转移到另一个账户中(Trans logins from one database to another ) Find the need for WinFx, understanding for very very beginners 使用vsto制作的outlook插件,安装加载失败
.net sqlserver 关于连接池没事释放的注意项
Heclei · 2008-08-23 · via 博客园 - Heclei

CAUTION   It is recommended that you always close the Connection when you are finished using it in order for the connection to be returned to the pool. This can be done using either the Close or Dispose methods of the Connection object. Connections that are not explicitly closed might not be added or returned to the pool. For example, a connection that has gone out of scope but that has not been explicitly closed will only be returned to the connection pool if the maximum pool size has been reached and the connection is still valid.

Note   Do not call Close or Dispose on a Connection, a DataReader, or any other managed object in the Finalize method of your class. In a finalizer, only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a Finalize method in your class definition. For more information, see Programming for Garbage Collection.

http://msdn.microsoft.com/en-us/library/aa719770.aspx

注意:在使用完成之后建议使用Close或Dispose关闭数据链接,确保链接可以返回链接池中。链接没有立即关闭可能是因为没有添加或返回到链接池中。例如:当一个链接在执行域结束后没有被关闭,那么它将在链接数达到最大值或链接无效时才返回数据库链接池中。

Note:不要在Finalize method(析构函数)中使用Close或者Dispose来释放Connection,DataReader或其他托管对象。在析构函数中,仅释放在对象中直接使用的非托管资源。如果你的对象中没有使用非托管资源,不要定义析构函数。