ADO.NET Connection Pooling & SQLServer

前端 未结 4 2021
礼貌的吻别
礼貌的吻别 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条回答
  •  逝去的感伤
    2021-01-20 15:16

    A little more info on the connection pooling thing... you're using it already with SqlClient, but only if your connection string is identical for each new connection you open. My understanding is that the framework will pool connections automatically when it can, but if the connection string varies even slightly from one connection to the next, then the new connection won't come from the pool - it gets created anew (so it's more expensive).

    You can use the Performance Monitor app with XP/Vista to watch SQL connections and you'll see pretty quickly whether or not pooling is being used. Look under the ".NET CLR Data" category" in Performance Monitor.

提交回复
热议问题