Should i use Pooling=False in Entity Framework Con

2019-02-15 12:16发布

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条回答
够拽才男人
2楼-- · 2019-02-15 12:42

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:

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

查看更多
登录 后发表回答