SqlConnection.ClearAllPools,清除了什么?
我有一个应用程序,它使用 SqlConnection.ClearAllPools
在删除数据库之前关闭所有连接。
存在连接仍然存在的情况。此连接是在另一个应用程序域中创建的。
所以我想知道 SqlConnection.ClearAllPools 关闭了哪些连接?
- 仅由调用进程(或AppDomain)打开的连接?
- 本机打开的所有连接?
- ...?
I have an application which uses SqlConnection.ClearAllPools
to close all connections before dropping a database.
There is a case where a connection is still there. This connection had been created in another application domain.
So I wonder which connections are closed by SqlConnection.ClearAllPools
?
- Only the connections opened by the calling process (or AppDomain)?
- All the connections opened by this machine?
- ...?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它仅关闭调用进程打开的所有连接。它清空绑定到该进程的所有连接池。 引用:
It closes all the connections opened by the calling process only. It empties all the connection pools which are bound to the process. Quote: