Entity framework Asp.NETMVC&;实体框架:多个用户使用应用程序时出错

Entity framework Asp.NETMVC&;实体框架:多个用户使用应用程序时出错,entity-framework,asp.net-mvc-4,sql-server-2008-r2,Entity Framework,Asp.net Mvc 4,Sql Server 2008 R2,我在生产环境中遇到了开发环境中没有的奇怪错误:当使用4个用户进行测试时,应用程序工作正常,没有错误,但是当10个用户同时使用应用程序时,我有多个错误,例如连接已打开或数据读取器需要有效连接。 我通过在我的connectionstring上启用MARS并使用“using blocks”来处理我的connections对象,成功地纠正了这个错误,但我仍然有其他错误,例如 An error occurred while executing the command definition. See the

我在生产环境中遇到了开发环境中没有的奇怪错误:当使用4个用户进行测试时,应用程序工作正常,没有错误,但是当10个用户同时使用应用程序时,我有多个错误,例如
连接已打开
数据读取器需要有效连接。
我通过在我的connectionstring上启用MARS并使用“using blocks”来处理我的connections对象,成功地纠正了这个错误,但我仍然有其他错误,例如

An error occurred while executing the command definition. See the inner exception for details.*InnerExceptionSystem.Data.SqlClient.SqlException (0x80131904): A severe error occurred on the current command.  The results, if any, should be discarded.

经过几次测试后,我在大多数函数中没有将错误
对象引用设置为对象的实例
,用户无法使用该应用程序,我必须重新启动IIS,以便用户可以再次使用该应用程序

是否有任何特定的IIS 7或/和SQL SERVER 2008 R2配置要执行?还是代码更改


谢谢你的帮助。

你的寿命是多少?这看起来像是多个线程对同一个上下文对象进行寻址。
Unable to set field/property Address on entity type System.Data.Entity.DynamicProxies.User_B22E7C85832E5768701582412113F0C185707EA5275299E638DA68EECEC6CCE5. See InnerException for details.*Inner exceptionSystem.IndexOutOfRangeException: Index was outside the bounds of the array.