This is the error message you will get when pool is maxed out.
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.
Please try closing reader, command, connection by using close() and dispose() before using the method below.
If the pooling is enabled in the application, sometime closing the connection by using Dispose() or Close() is just going to put the connection on the sleep mode (awaiting command). Even though there is connection closing statements on the application, on the database side, it was putting those connections on the sleep mode. As it built up, there were no more pool left, therefore it timed out.
Solution is to add Pooling = False
on the connection string of the application. This closes the connection as soon as dispose() is introduced. Hence no timeouts waiting for open pool.
Database=testdb; Server=testserver; uid=test; PWD=test; Pooling=False; Connect Timeout=30
I am not responsible if you use my solution and mess up something. Do at your own risk. Works for me here.
Checking number of connections on database to see if max pool has reached …
--Total number of connections
SELECT DB_NAME(dbid) AS 'Database Name',
COUNT(dbid) AS 'Total Connections'
FROM sys.sysprocesses WITH (nolock)
WHERE dbid > 0
GROUP BY dbid;
SELECT hostname, program_name, STATUS, cmd FROM sys.sysprocesses
WHERE DB_NAME(dbid) = 'Database Name goes here';
This script removes the ^M character from the file. Mainly for those who use windows editor to edit Unix/Linux text files. I would definitely recommend VI or emacs if you are messing with Unix/Linux text files.
Create a shell script file and copy paste the code below.
#Script to remove the ugly DOS ^M characters
for readfiles in $@
tr -d 'r' < $readfiles > $sometempfile.tmp
mv $sometempfile.tmp $readfiles