开发者

pre-requisite for connection pooling [closed]

开发者 https://www.devze.com 2023-02-14 02:23 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its curren开发者_如何学Pythont f
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its curren开发者_如何学Pythont form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

What is a pre-requisite for connection pooling?

Thank you.


Assuming you mean database connections, the main points are:

  • they must all use exactly the same connection string
  • it is per-AppDomain
  • for SSPI etc, the implicit user account must be common (i.e. the same domain user is being represented, or it will form multiple pools)
  • it must be enabled and supported by the provider; in the case of SqlConnection it is on by default
  • you must have not explicitly disabled the pool

For most common cases using SqlConnection, this just means "will be pooled per unique connection-string" - the rest is automatic and just works.

also; remember to use using statements around your connection usage, so you release things back to the pool even in exception - otherwise you'll exhaust it.


A very interesting article although I am not entirely sure whether or not it is still valid.

0

精彩评论

暂无评论...
验证码 换一张
取 消