Another project error is reported today:
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and Max pool size was reached.
The first response is that the brother wrote datareader and did not close it. This does not start to look for datareader in the whole project. Well, let alone, there are two fucking readers working there ....
After half a day, errors come back ....
This can make me depressed. The next thought is of course to view the number of data links. The link corresponding to the query is not closed.
There are different ways to view the number of links on the Internet, and there is no such statement ....
First:
Select * From DBO. sysprocesses where db_name (dbid) = 'youdbname'
This is not the so-called Number of connections...
Of course, it still has a certain relationship with the number of connections, as long as a click, the total number will increase a few, after the reset, it will reach more than 600 in half an hour...
Khan ....
Who? Who did it? The link corresponding to the statement cannot be found...
No way, you can only get it done. Now that you know this stuff has a certain relationship with the connection, let's take a look at its specific information.
Check msdn and find that the SQL _handle field corresponds to the SQL statement ....
The next thing, of course, is to find the corresponding SQL statement.
Use master
Select db_name (s1.dbid ),
S2.text
From sysprocesses as S1
Cross apply SYS. dm_exec_ SQL _text (SQL _handle) as S2
Where s2.objectid is null
Order by s1. SQL _ HANDLE
Now you know what it is, and you will know which statement corresponds to a high number of connections. When you know the statement, you will know that the corresponding operation is not closing the connection...
In this way, it is more convenient to find the problem that the number of connections is too high?