Last post Aug 07, 2019 06:32 AM by PatriceSc
Aug 07, 2019 01:51 AM|e.osh|LINK
I have an ASP.net application connecting to MS SQL by using System.Data.SqlClient. I have been facing connection issue randomly and over 200 users, 2 -5 users facing this issue daily.
I have checked and confirm all connections are properly opened and closed after execution. Is this something related to Connection Pool? I have a default setting (Max Pool Size 100)
Aug 07, 2019 06:10 AM|Yang Shen|LINK
If there's anything wrong with your connection pool, the error message is mostly like "Timeout expired." rather than others like you provided above. This kind of issue often appears when a connection is not closed in time. Please refer to: Here.
As for the problems you provided, if you can provide related code where the error messages were threw will be very helpful.
Aug 07, 2019 06:32 AM|PatriceSc|LINK
No, usually you then have a timeout message telling you can't get a connection from the pool.
You attempted to share a single connection accros users using a static connection? Or to have exactly one connection for each user which is opened for as long as possible ?
The default starting point is to open/close connections as needed (which is still efficient thanks to connection pooling) and so by design the connection is always in a known state.
DON'T try tto fix this by adding code to test the connection state and then act accordingly.