执行超时问题 [英] Execution Timeout Problem

查看:86
本文介绍了执行超时问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的asp.net Web应用程序在bin目录中使用.NET组件(DLL)来调用

几个存储过程来重新执行更新。他们没有返回

任何数据。有时总执行时间可能需要2-3分钟,但即使我已经将web.config中的executionTimeout设置为大量的

秒(2400),请求仍会在90秒后超时。用户

看到请求超时错误。该应用程序记录一个ThreadAborted异常,

[线程被中止]。


Web应用程序和组件在发布模式下编译。我读到你

只需要设置一个属性; IIS中的executionTimeout或ScriptTimeout

属性,但不是两者都有。是真是假?


感谢您的帮助,


Mark

解决方案

你应该考虑重新设计这个长期运行的工作,这样浏览器就不会等待它完成。因此,创建一个启动工作的按钮,然后

使用户能够刷新页面以查看待处理的工作。要启动工作,你必须以某种方式启动另一个线程(所以使用

ThreadPool.QueueUserWorkItem,或手动创建另一个线程;有

这些方法的优点和缺点)。要监控待处理的工作,您需要在数据库中使用其他状态表,用户可以在其中查看工作是否完成。一旦它,更新该表。


无论如何,只是一个关于如何重做这项长期任务的想法....


- Brock

DevelopMentor
http://staff.develop。 com / ballen

我们的asp.net Web应用程序使用bin目录中的.NET组件(DLL)来回调用几个存储过程执行更新。
他们不会返回任何数据。有时总执行时间可能需要2-3分钟,但即使我已将
web.config中的executionTimeout设置为高秒数(2400),该请求仍将是
90秒后超时。用户看到请求超时错误。
应用程序记录一个ThreadAborted异常,[线程被中止]。

Web应用程序和组件在发布模式下编译。我读到你只需要设置一个属性; IIS中的executionTimeout或
ScriptTimeout属性,但不是两者。是真是假?

感谢您的帮助,

Mark




Brock,


感谢您的回复,这听起来不错。 AJAX是否允许我启动长期运行任务并让用户刷新

页面以获取状态?我在AJAX上读了一两篇文章,但还没有使用它。$ / b

谢谢,


Mark


" Brock Allen" < BA **** @ NOSPAMdevelop.com>在留言中写道

news:11 *********************** @ msnews.microsoft.co m ...

你应该考虑重新设计这个长期运行的工作,这样浏览器就不会等待它完成。因此,创建一个启动
工作的按钮,然后让用户刷新页面以查看待处理的工作。要开始工作,你必须以某种方式启动另一个线程(所以使用ThreadPool.QueueUserWorkItem,或者手动创建另一个线程;这些方法各有利弊)。要监控待处理的工作,您需要在数据库中使用其他状态表,您的
用户可以查看工作是否完成。一旦它,更新该表。
无论如何,只是一个关于如何重做这项长期任务的想法......

-Brock
DevelopMentor
http://staff.develop.com/ballen

我们的asp.net Web应用程序在bin目录中使用.NET组件(DLL)来连续调用几个存储过程来执行更新。
它们不会返回任何数据。有时总执行时间可能需要2-3分钟,但即使我已将
web.config中的executionTimeout设置为高秒数(2400),该请求仍将是
90秒后超时。用户看到请求超时错误。
应用程序记录一个ThreadAborted异常,[线程被中止]。

Web应用程序和组件在发布模式下编译。我读到你只需要设置一个属性; IIS中的executionTimeout或
ScriptTimeout属性,但不是两者。是真是假?

感谢您的帮助,

Mark




好吧,你需要以某种方式访问​​服务器以启动长时间运行的

任务。如果这是一个AJAX电话或正常的页面帖子都没关系。相同的

用于刷新页面以检查状态;不知怎的,你需要联系

服务器。这两种方法都有效。


-Brock

DevelopMentor
http://staff.develop.com/ballen

Brock,

感谢您的支持回复,这听起来是个好主意。 AJAX是否允许我启动长时间运行的任务并让用户能够刷新页面以获取状态?我已经阅读了一篇关于AJAX的文章,但尚未使用它。

谢谢,

标记

" ;布洛克艾伦 < BA **** @ NOSPAMdevelop.com>在消息中写道
新闻:11 *********************** @ msnews.microsoft.co m ...

你应该考虑重新设计这个长期运行的工作,这样浏览器就不会等待它完成。因此,创建一个启动
工作的按钮,然后让用户刷新页面以查看待处理的工作。要开始工作,你必须以某种方式启动另一个
线程(所以使用ThreadPool.QueueUserWorkItem,或者手动创建另一个线程;这些方法各有利弊)。要监控待处理的工作,您需要在DB中使用其他状态表,用户可以在其中查看工作是否完整。一旦它,更新该表。无论如何,只是想知道如何重做这项长期任务......

-Brock
DevelopMentor
http://staff.develop.com/ballen

我们的asp.net网络应用程序使用了。 bin目录中的.NET组件(DLL)
来回调用几个存储过程来执行更新。
他们不会返回任何数据。有时总执行时间可能需要2-3分钟,但即使我已将
web.config中的executionTimeout设置为高秒数(2400),请求仍将是
90秒后超时。用户看到请求超时
错误。该应用程序记录一个ThreadAborted异常,[线程正在中止]。

Web应用程序和组件在发布模式下编译。我读到你只需要设置一个属性; IIS中的executionTimeout或
ScriptTimeout属性,但不是两者。是真是假?

感谢您的帮助,

Mark




Our asp.net web app uses a .NET component (DLL) in the bin directory to call
several stored procedures back to back to perform updates. They don''t return
any data. Sometimes the total execution time can take 2-3 minutes, but even
though I have set the executionTimeout in web.config to a high number of
seconds (2400), the request will still time out after 90 seconds. The user
sees a Request timed out error. The app logs a ThreadAborted exception,
[Thread was being aborted].

The web app and the component are compiled in Release mode. I read that you
only have to set one property; executionTimeout or the ScriptTimeout
property in IIS, but not both. Is that true or false?

Thanks for your help,

Mark

解决方案

You should consider redesigning this long running work so the browser isn''t
waiting for it to complete. So make a button that initiates the work, then
give the user the ability to refresh the page to see the pending work. To
initiate the work you''ll have to kick off another thread somehow (so use
ThreadPool.QueueUserWorkItem, or manually create another thread; there are
pros and cons to each of these approaches). To monitor the pending work you''ll
need some other status table in the DB where your user can see if the work
is complete. Once it is, update that table.

Anyway, just an idea on how to rework this long running task....

-Brock
DevelopMentor
http://staff.develop.com/ballen

Our asp.net web app uses a .NET component (DLL) in the bin directory
to call several stored procedures back to back to perform updates.
They don''t return any data. Sometimes the total execution time can
take 2-3 minutes, but even though I have set the executionTimeout in
web.config to a high number of seconds (2400), the request will still
time out after 90 seconds. The user sees a Request timed out error.
The app logs a ThreadAborted exception, [Thread was being aborted].

The web app and the component are compiled in Release mode. I read
that you only have to set one property; executionTimeout or the
ScriptTimeout property in IIS, but not both. Is that true or false?

Thanks for your help,

Mark




Brock,

Thanks for your reply, it sounds like a good idea. Will AJAX allow me to
initiate the long running task and give the user the ability to refresh the
page to get the status? I have read an article or two on AJAX but haven''t
used it yet.

Thanks,

Mark

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:11***********************@msnews.microsoft.co m...

You should consider redesigning this long running work so the browser
isn''t waiting for it to complete. So make a button that initiates the
work, then give the user the ability to refresh the page to see the
pending work. To initiate the work you''ll have to kick off another thread
somehow (so use ThreadPool.QueueUserWorkItem, or manually create another
thread; there are pros and cons to each of these approaches). To monitor
the pending work you''ll need some other status table in the DB where your
user can see if the work is complete. Once it is, update that table.
Anyway, just an idea on how to rework this long running task....

-Brock
DevelopMentor
http://staff.develop.com/ballen

Our asp.net web app uses a .NET component (DLL) in the bin directory
to call several stored procedures back to back to perform updates.
They don''t return any data. Sometimes the total execution time can
take 2-3 minutes, but even though I have set the executionTimeout in
web.config to a high number of seconds (2400), the request will still
time out after 90 seconds. The user sees a Request timed out error.
The app logs a ThreadAborted exception, [Thread was being aborted].

The web app and the component are compiled in Release mode. I read
that you only have to set one property; executionTimeout or the
ScriptTimeout property in IIS, but not both. Is that true or false?

Thanks for your help,

Mark




Well, you need to access the server somehow to initiate the long running
task. It doesn''t matter if that''s an AJAX call or a normal page post. Same
thing for refreshing thew page to check the status; somehow you need to contact
the server. Both approaches will work.

-Brock
DevelopMentor
http://staff.develop.com/ballen

Brock,

Thanks for your reply, it sounds like a good idea. Will AJAX allow me
to initiate the long running task and give the user the ability to
refresh the page to get the status? I have read an article or two on
AJAX but haven''t used it yet.

Thanks,

Mark

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:11***********************@msnews.microsoft.co m...

You should consider redesigning this long running work so the browser
isn''t waiting for it to complete. So make a button that initiates the
work, then give the user the ability to refresh the page to see the
pending work. To initiate the work you''ll have to kick off another
thread somehow (so use ThreadPool.QueueUserWorkItem, or manually
create another thread; there are pros and cons to each of these
approaches). To monitor the pending work you''ll need some other
status table in the DB where your user can see if the work is
complete. Once it is, update that table. Anyway, just an idea on how
to rework this long running task....

-Brock
DevelopMentor
http://staff.develop.com/ballen

Our asp.net web app uses a .NET component (DLL) in the bin directory
to call several stored procedures back to back to perform updates.
They don''t return any data. Sometimes the total execution time can
take 2-3 minutes, but even though I have set the executionTimeout in
web.config to a high number of seconds (2400), the request will
still time out after 90 seconds. The user sees a Request timed out
error. The app logs a ThreadAborted exception, [Thread was being
aborted].

The web app and the component are compiled in Release mode. I read
that you only have to set one property; executionTimeout or the
ScriptTimeout property in IIS, but not both. Is that true or false?

Thanks for your help,

Mark




这篇关于执行超时问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆