ADO.NET Connection Pooling & SQLServer

前端 未结 4 2023
礼貌的吻别
礼貌的吻别 2021-01-20 15:04
  • What is it?
  • How do I implement connection pooling with MS SQL?
  • What are the performance ramifications when
    • Executing ma
4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-20 15:11

    Connection pooling is a mechanism to re-use connections, as establishing a new connection is slow.

    If you use an MSSQL connection string and System.Data.SqlClient then you're already using it - in .Net this stuff is under the hood most of the time.

    A loop of 30k iterations might be better as a server side cursor (look up T-SQL cursor statements), depending on what you're doing with each step outside of the sproc.

    Long queries are fine - but be careful calling them from web pages as Asp.Net isn't really optimised for long waits and some connections will cut out.

提交回复
热议问题