首页 > 编程语言 >Long-Time Process on web (ASP.NET Long-Running Operations)

Long-Time Process on web (ASP.NET Long-Running Operations)

时间:2023-11-17 10:02:13浏览次数:39  
标签:Operations web www aspxhttp Long job NET com ID

a) Creating a webservice that calls a Thread?
b) Creatinga webservice with [SoapDocumentMethod(OneWay=true)]
c) Any better way? without using an external program?

Another way is queuing jobs. MSMQ or Service Broker (SQL Server 2005).
1. Create a job class instance in .NET and assign a unique id to it (GUID,
auto incr in some table).

public class Job    
{    
string ID;    
}


1.1 This class is a great place to put in the criterias required to perform
the long-running task.
2. Track the job. For example: with the Ticket (Job.ID), INSERT TABLE
tblJobs SET Completed = FALSE WHERE ID = @ID
3. When the job is done make sure the job executor updates the completion
bucket to say the job is done.
UPDATE tblJobs SET Completed = TRUE WHERE ID = @ID
4. Until then, give your response page the Job ID. It will refresh (great
place to add an AJAX enabled progress bar) and use that ticket to check
whether the job is done or not in the completion bucket:
With the Ticket (Job.ID), Query for SELECT TOP 1 WHERE Completed = TRUE AND
ID = @ID

 

http://www.beansoftware.com/ASP.NET-Tutorials/Long-Operations.aspx

http://www.velocityreviews.com/forums/t119804-long-process-in-aspnet.html

http://msdn.microsoft.com/zh-cn/magazine/cc163725(en-us).aspx

http://stackoverflow.com/questions/579861/handling-long-page-execution-times-in-asp-net

http://www.ajaxmatters.com/articles/asp/long_run_process_p1.aspx

http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23091386.html

http://www.eggheadcafe.com/articles/20051223.asp

http://geekswithblogs.net/joycsharp/archive/2007/11/22/117039.aspx

http://www.aspfree.com/c/a/VB.NET/Executing-LongRunning-Tasks-with-the-Progress-Bar-in-ASPNET/

http://www.codeproject.com/KB/aspnet/asynctransactionhandler.aspx

http://dotnetslackers.com/ASP_NET/re-17817_ASP_NET_Long_Running_Tasks_with_Page_Feedback.aspx

http://weblogs.asp.net/ssharrock/archive/2004/02/02/66321.aspx

http://msdn.microsoft.com/en-us/magazine/2009.01.longrunwf.aspx

http://codebetter.com/blogs/peter.van.ooijen/archive/2006/06/20/146582.aspx

http://forums.asp.net/t/1276827.aspx

http://www.velocityreviews.com/forums/t116366-running-long-process-from-aspnet.html

http://stackoverflow.com/questions/617105/asp-net-httphandlers-and-long-running-processes

http://www.marklio.com/marklio/PermaLink,guid,de1c560e-9f2f-43e3-830e-3e195fbebea5.aspx



标签:Operations,web,www,aspxhttp,Long,job,NET,com,ID
From: https://blog.51cto.com/emanlee/8436718

相关文章

  • Web服务端开发的线程问题
    Web服务端和线程安全问题 线程和类有关联吗?线程(Thread)和类(Class)在计算机编程中是两个不同但可以关联的概念。线程(Thread):线程是指在进程中执行的独立的执行单元。一个进程可以包含多个线程,它们共享进程的资源,但每个线程有自己的执行流。多线程的编程可以提高程序的并发性,......
  • Websphere - WSVR0605W 错误
    官方连接:https://www.ibm.com/support/pages/wsvr0605w-thread-may-be-hung-message-logsWSVR0605W-"Threadmaybehung"messageinthelogsTroubleshootingProblemAWSVR0605WmessageintheSystemOut.logmightbemisleadingbecausethismessagenorma......
  • web02
    域对象  (域对象通常是指具有属性的对象,也被称为属性对象。)requesthttpSessionsession会话对象session的生命周期第一次向服务器请求获取session会创建session对象;session有一个标识sessionID,tomcat会将这个sessionID以cookie的方式发送给浏览器,浏览器再访问该网站会......
  • JavaWeb--响应字符&字节数据
    Response响应字符数据 //text/html解码html,charset解码汉字response.setContentType("text/html;charset=utf-8");//1、获取字符输入流PrintWriterwriter=response.getWriter();writer.write("你好");writer.write("<h1>124</h1>");响应字节数据添加一个i......
  • 内网走nginx代理访问高德webapi2.0
    需求:客户的电脑都只能访问内,服务器可以访问外网,客户电脑使用的项目中用到了高德webapi2.0。10.200.31.45:32100是我们的web服务器。网上基本上都是对高德webapi1.4的配置方式,而web2.0有一些差别。1.前端修改高德地图的js应用如果是index.html引入,修改之前的应用:<script......
  • JavaWeb--Reaponse设置响应数据功能介绍&完成重定向
    Response设置响应数据功能Response完成重定向重定向(Redirect):一种资源跳转方式*redirect一定地址是8080往后补的,一定要写全也可以是外部地址 路径问题: 动态获取虚拟目录//动态获取虚拟目录StringcontextPath=request.getContextPath();response.sendRedirect(con......
  • @WebServiceClient wsdlLocation 动态给注解内容参数赋值
    动态给注解内容参数赋值@WebServiceClient(name="IXxxService",targetNamespace="http://xxx.xxx.xxx.com",wsdlLocation="${WSDL_URL}")publicclassIXxxServiceextendsService{ //静态变量在静态代码块加载后加载,且注解也在之后加载,完成动态注入修改注解里的参......
  • webpack配置优化
    Webpack是一个非常强大的模块打包器,用于处理和打包前端资产。随着项目的复杂性增加,配置文件和优化Webpack的性能就变得非常重要。以下是一些关于如何优化Webpack配置的策略:使用最新版本的Webpack:每个新版本的Webpack都可能包含性能改进和修复。确保你的项目使用的是最......
  • Fiddler not intercepting PowerShell web requests
    FiddlernotinterceptingPowerShellwebrequestsFiddleractuallyworksviaaproxy,andautomaticallysetsproxysettingsinIEwhenrunning.Youcancheckthisbylaunchingfiddlerandthenchecking"LanSettings"underInternetOptions>......
  • VS 2005/2008 Web Setup Project
     Tip/Trick:CreatingPackagedASP.NETSetupProgramswithVS2005http://weblogs.asp.net/scottgu/archive/2007/06/15/tip-trick-creating-packaged-asp-net-setup-programs-with-vs-2005.aspx 如何用VS2005制作Web安装程序 TwoQuickTipsonWebSetupinVisualStudioh......