LinQ 尝试读取或写入受保护的内存。这通常表明其他内存已损坏
我收到内存访问冲突错误:
System.AccessViolationException:尝试读取或写入受保护的内存。这通常表明其他内存已损坏。
线程信息: 线程 ID:5 线程帐户名称:IIS APPPOOL\OpenSpanServerAppPool 是否冒充:假 堆栈跟踪:位于 System.Linq.Enumerable.WhereEnumerableIterator1.Select[TResult](Func
2 选择器) 在 System.Linq.Enumerable.Select[TSource,TResult](IEnumerable1 源,Func
2 选择器) 在 System.Web.Mvc.MvcHandler.RemoveOptionalRoutingParameters() 在System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext,IController&控制器,IControllerFactory&工厂) 在 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext,AsyncCallback 回调,对象状态) 在 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext,AsyncCallback 回调,对象状态) 在System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext上下文,AsyncCallback cb,对象extraData) 在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 在 System.Web.HttpApplication.ExecuteStep(IExecutionStep 步骤,Boolean&completedSynchronously)
我正在使用 asp.net MVC,NHibernate,我的网站托管在 IIS 中,有自己的池,数据库是 SQL Server 2005 sp3。
您看到与此问题相关的内容了吗?
我认为这可能与 MS SQL 空闲断开连接有关...
知道吗?
我将不胜感激你的帮助。
I am getting the memory access violation error:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Thread information:
Thread ID: 5
Thread account name: IIS APPPOOL\OpenSpanServerAppPool
Is impersonating: False
Stack trace: at System.Linq.Enumerable.WhereEnumerableIterator1.Select[TResult](Func
2 selector)
at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable1 source, Func
2 selector)
at System.Web.Mvc.MvcHandler.RemoveOptionalRoutingParameters()
at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I am using asp.net MVC, NHibernate and my site is hosted in IIS with its own pool , DB is SQL Server 2005 sp3.
Did you see something related to this issue?
I think it is related maybe to MS SQL idle disconnection...
Any idea?
I would appreciate your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们时常遇到同样的问题。我认为 Sam 找到了答案,我们的问题似乎是因为我们延迟评估数据库读取并且连接超时。通过在数据层中放置 ToList 调用以确保转换更早发生,该问题似乎已得到解决。
We've hit the same issue from time-to-time. I think Sam hit the answer, our problem appears to be because we late evaluating our database read and the connection had timed out. The problem appears to have been resolved by putting a ToList call in our data layer to make sure the conversion happens earlier.
我在 Linq 表达式中遇到了同样的错误。我能够通过检查数据库连接的状态来解决它。如果 State 关闭,则会出现错误。因此,如果连接已关闭,请打开它。
I hit this same error in a Linq expression. I was able to resolve it by checking the State of the DB Connection. If the State is closed, the error comes up. So open up the connection if it's closed.