【发布时间】:2012-03-13 15:12:56
【问题描述】:
我有一个带有 DevExpress MVC 控件和默认设置的 MVC3 应用程序
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
在 RegisterRoutes 中,但来自 DevEx 的以下 URL 包括:
/DXR.axd?r=1_3,1_4...
/DXR.axd?r=1_42,1_41,14_18,14_2,...
只调用 Application_EndRequest() 而不调用 Application_BeginRequest()。
目前,这导致了绑定/取消绑定 nHibernate CurrentSessionContext 的奇怪解决方法...可能有更好的方法将这些 URL 排除为 Application_EndRequest() 中的字符串比较?
(参考:
In what situation Application_EndRequest is called but Application_BeginRequest is not called?
我找不到任何例外,它只涉及上述 DevEx URL)
【问题讨论】:
-
你在哪里初始化 nhibernate?
-
在 Application_Start 中...所有其他请求,包括。 “动作”调用方法和 nHibernate 效果很好
-
为什么不在会话开始时为 nhibernate 绑定会话处理?
-
我有类似this这样的场景来实现“每个请求的会话”模式
标签: c# asp.net asp.net-mvc-3 devexpress