C# SQLConnection pooling

前端 未结 3 497
南旧
南旧 2020-12-06 09:58

Can anyone brief me how to do Connection Pooling in ADO.Net, I do need to connect to 3 separate databases. 2 of them are in same server and the other in a separate one.

3条回答
  •  悲&欢浪女
    2020-12-06 10:45

    Certain providers do not provide connection pooling. To my knowledge this includes connection strings to Microsoft Access Databases (Jet) and SQL Server CE (Compact edition).

    The lack of connection pooling for those make database access remarkably slower.

    A solution to the missing Jet pooling was for me to always have one single connection to the Jet database open for the whole program lifetime (contrary to what the recommended technique is). This speeded up my Jet Access database SQL queries from .NET applications tremendously, but also only works on local Jet databases; for Jet databases on network shares, I get relatively fast exceptions about too many open file handles.

    For SQL Server CE, I found no solution so far.

提交回复
热议问题