Entity framework 4 not closing connection in sql server 2005 profiler

后端 未结 1 349
灰色年华
灰色年华 2021-01-21 10:09

I\'m using entity framework 4 for the first time in an ASP.net application. I wanted to make sure that DB connections are closed after leaving the using statement, however, in t

相关标签:
1条回答
  • 2021-01-21 10:16

    Yes, there is something in SQL Server that will keep the connection open: connection pooling. As opening and closing database connections is an expensive operation, SQL Server manages a pool of connections that it will assign to connection requests. Roughly speaking, if the request connection string matches the connection string of a inactive connection in the pool, SQL Server will assign the connection to the request.

    0 讨论(0)
提交回复
热议问题