Monday, October 25, 2010

Connection String Settings: Timeouts and Pooling



If you are having SQL Server Database connection issues, I reckon they could be due to one of two connection string issues. Note that the connection string timeout is the 15s by default, so in the string below I triple it, for example, to 45 second (or on could try 30s as an incremental step), and secondly, if you do not want pooling you have to explicitly state you so not want it, as so:

If you are using Windows Authentication, or Integrated Security in Connection string lingo, here’s an example that disables Pooling:
Server=<SQL Server Instance>;Connection Timeout=45;Integrated Security=SSPI;
Pooling=falseOr if are using SQL Server authentication:
Server=<SQL Server Instance>;Connection Timeout=45;uid=;pwd=;Pooling=false

There is also the dynamic system view sys.dm_exec_connections , but I am intentionally brief on this since fellow MVP Glenn Berry has done such a great job already and recently on this within his DMV a day series J





No comments:

Post a Comment