何时以及为什么触发TimerCallback?

时间:2010-03-04 18:49:14

标签: asp.net

我们有一个运行在IIS6上的asp.net应用程序,带有.net 2.0(XP),可以在按钮点击事件中调用Web服务。完成Web服务需要30多分钟。但不知怎的,经过一段时间后,通常在20~30分钟之间,asp.net又做了一次按钮点击事件的回发,导致我们的应用程序出现问题。

跟踪堆栈(见下文)显示回发是由Threading.TimeCallback触发的。有谁知道为什么?或与IIS设置有关的任何内容?

赞赏! 迈克尔

at ASP.platform_workflow_executeworkflow_aspx.ProcessRequest(HttpContext context) 在System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 在System.Web.HttpApplication.ExecuteStep(IExecutionStep step,Boolean& completedSynchronously) 在System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(异常错误) 在System.Web.HttpApplication.ResumeStepsFromThreadPoolThread(异常错误) 在System.Web.HttpApplication.AsyncEventExecutionStep.ResumeStepsWithAssert(异常错误) 在System.Web.HttpApplication.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) 在System.Web.HttpAsyncResult.Complete(布尔同步,对象结果,异常错误,RequestNotificationStatus状态) 在System.Web.SessionState.SessionStateModule.PollLockedSessionCallback(对象状态) 在System.Threading.ExecutionContext.runTryCode(Object userData) 在System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode代码,CleanupCode backoutCode,Object userData) 在System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback回调,对象状态) 在System.Threading._TimerCallback.PerformTimerCallback(对象状态)

1 个答案:

答案 0 :(得分:0)

可能是会话超时的问题。增加会话超时时间可以解决问题。

但是,如果运行的时间很长,那么考虑WebService异步并在进程运行时向用户提供一些信息可能会更好。