none
SPLongOperation - The remote host closed the connection

    Question

  • 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";
                    operation.Begin();
                    // 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. 


    


    Wednesday, September 11, 2013 4:29 PM

Answers

  • Hi,

    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..


    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

    Thursday, September 12, 2013 3:15 AM