如何确定连接池中已使用的连接数 [英] how to determinethe number of used connections in connection pool

查看:206
本文介绍了如何确定连接池中已使用的连接数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在我的连接字符串中,启用了池化,并将其设置为0到40个连接.
有时我的系统中还会有一封电子邮件,告诉我连接池资源不足.

有没有一种方法可以确定是否使用了池中的连接数以及附带的SqlCommand对象是什么.这样,我可以确定哪些数据库调用已完成但仍处于打开状态(并找到我自己创建的错误).

Hi All,

In my connectionstring Pooling is enabled and set in range from 0 to 40 connections.
Still sometimes I have a email from my system that tells me the connectionpool is out of resources.

Is there a way to determin if how many connections in the pool are used and what the accompanying SqlCommand object is. In this way I can determine which db calls are finished but are left open (and find the bug I created myself)

推荐答案

很可能可以监视池也可以从代码中获取,但是这些更易于使用:
http://www.c-sharpcorner.com/blogs/1713/monitoring-connection- pooling.aspx [ ^ ]
http://www.wduffy.co.uk/blog/monitoring-database-connections/ [< ^ ]
http://msdn.microsoft.com/en-us/library/aa175863 (v = sql.80).aspx [
It is likely that you can monitor the pool from code also, but these are easier to use:
http://www.c-sharpcorner.com/blogs/1713/monitoring-connection-pooling.aspx[^]
http://www.wduffy.co.uk/blog/monitoring-database-connections/[^]
http://msdn.microsoft.com/en-us/library/aa175863(v=sql.80).aspx[^]


这篇关于如何确定连接池中已使用的连接数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆