1

During app loading a single user will add 10 connections to the pool. Then if I load another user I will have a total of 20 connections.

Why are new connections being added to the pool instead of reusing connections? I can see that that there are connections available that haven't been used in minutes yet it still opens new connections.

  • Its the same connection string
  • I ran SQL Sever Profiler I can see sp_reset_connection being called after every call.

Any help would be appreciated.

James Grigley
  • 83
  • 1
  • 8
  • This [link](http://stackoverflow.com/questions/641120/what-exec-sp-reset-connection-shown-in-sql-profiler-means) might be helpful for you. – Nilesh Sep 06 '13 at 15:39

1 Answers1

2

If the connections are coming from a different machine, the connections can't be pooled. A connection required both endpoints to be a connection. If you are using connection pooling correctly, applications instantiate a connection (from the pool), use the connection, then drop it as soon as exchange is complete.

If you a writing a single-threaded desktop app, another common and simple strategy is to open a connection, and just leave that connection open as long as the application is running.

You can control how many connections are created, etc. see MS article for more details related to connection pooling.

IIRC, connection pools are not shared unless the connection string is identical either.

Gary Walker
  • 8,831
  • 3
  • 19
  • 41