您好,欢迎访问一九零五行业门户网

mysql ExecuteReader问题_MySQL

今天遇到一棘手问题,在调用executereader时,出现如下异常信息:
the timeout period elapsed prior to obtaining a connection from the pool ...通过调用show processlist查看链接数,原来挂了几百个链接,没有及时释放。
代码在调用reader之后,系统没有关闭connection,结果导致connection不够用。
ps:
命令: show processlist;
如果是root帐号,你能看到所有用户的当前连接。如果是其它普通帐号,只能看到自己占用的连接。
show processlist;只列出前100条,如果想全列出请使用show full processlist;
set global wait_timeout=100
设置连接等待时间为100毫秒。
其它类似信息

推荐信息