I have a sharepoint long operation where files copied from network location to sharepoint document library. Code is as follows
using(SPLongOperation operation = new SPLongOperation(this.Page))
operation.LeadingHTML = "Some HTML" operation.TrailingHTML = "Some HTML";
// Code to copy files from netwrok location to document library
operation.End(currentURL, Microsoft.SharePoint.Utilities.SPRedirectFlags.Default, this.Context,"");
everything is working fine till load is around 1000 files of average 500 kbs or time duration is less. When increasing the files or size of the files, process takes long time like 45 minutes and after completion of the process,
following error is coming
SRPPRFileManagementWebPart Event Message System.Web.HttpException (0x800704CD): The remote host closed the connection. The error code is 0x800704CD.
at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
at System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)
at Microsoft.SharePoint.SPLongOperation.EndScript(String strScript)
at Microsoft.SharePoint.SPLongOperation.End(String strProposedRedirect, SPRedirectFlags rgfRedirect, HttpContext context, String queryString, String strScript)
at Microsoft.SharePoint.SPLongOperation.End(String strProposedRedirect, SPRedirectFlags rgfRedirect, HttpContext context, String queryString)
The error is occuring when sharepoint ending th SPLongoperation and trying to Flush the memory. Please suggest any solution. Thanks.
Most probably the issue is with session/security validation of the page. You can try to adjust the security validation settings from Central Admin => Web Application Settings => General Settings, and then under 'Web Page Security validation' section
you can adjust value for 'Security Validation expires' which is default 30 minutes.
But maybe the solution is to use TimerJob to run these kind of long jobs. SPLongOperation best fits for scenario where user is waiting for few minutes..
Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.