Should i use Pooling=False in Entity Framework Connection String?

旧时模样 提交于 2019-12-19 04:14:38

问题


We have an ASP.Net MVC3 application that is running on Azure, connecting to a Sql Azure Database via Entity Framework.

The Developer that produced this has Pooling=False in the connection string. I would have thought this was a bad idea - wouldn't we want to re-use the connections if possible?

Can anyone give me some guidance of when this might be a good idea?

Thanks!


回答1:


Yes, it is bad idea to have pooling=False. I don't use this option even for development. You should always use the SQL Server Connection Pooling.

What you have to be aware of, however is the Transient Errors in SQL Azure. There are a couple of good reading that can be found on the Internet on how to handle Transient Errors in SQL using Entity Framework. Here is a (non-complete) list of some:

  • Best practices for handling Transient conditions in SQL Azure
  • SQL Azure and EF fault handling
  • EF CodeFirst and Transient Errors
  • Handling Transient Errors in SQL Azure

Always use connection pooling, but be aware of the Transient conditions in SQL Azure.



来源:https://stackoverflow.com/questions/10597051/should-i-use-pooling-false-in-entity-framework-connection-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!