进程内存使用率上升到1.8GB - 是否有更有效的写入方式?

时间:2017-03-15 14:37:44

标签: javascript ajax sharepoint-2013

我正在阅读文件的内容并将其写入SharePoint外部列表(SQL)。文件中有大约35000行。我在SharePoint中收到以下错误,并且进程内存使用率上升到1.8GB(这是发生错误时)大约有10000条记录使它 - 是否有更有效的方法在客户端写入以使用更少的内存或者是否有限制一次可以发送到外部SharePoint列表的数据量?

  

SCRIPT7002:XMLHttpRequest:网络错误0x2ee4,无法完成   由于错误00002ee4

的操作
function readFile() {     
    /*Access Sharepoint Web*/
    var clientContext;
    var oWebsite;
    var fileUrl;

    clientContext = new SP.ClientContext.get_current();
    oWebsite = clientContext.get_web();
    clientContext.load(oWebsite);
    /*Loads the content of specified text file*/
    //we will declare the text file name to be the most recent added by   

    clientContext.executeQueryAsync(function () {
        fileUrl = oWebsite.get_serverRelativeUrl() + "/MytextFile.txt";
        $.ajax({
            url: fileUrl,
            type: "GET",
            contentType:"application/json; charset=utf-8"
        })
        .done(Function.createDelegate(this, successHandlerrf))
        .error(Function.createDelegate(this, errorHandlerrf));
    }, errorHandler);

    function successHandlerrf(data) {
        var lines = data.split('\n');
        var lineItems = lines.length;
        var lines1 =[];

        for(i;i<=x ;i++){
            lines1 = lines[i].substring(0,14); 
            oListItem.set_item('Document_Number', lines1).trim();
            oListItem.update();
            clientContext.load(oListItem);

            // break;
            clientContext.executeQueryAsync( );
   }
   $('#loading').html('');
   alert("Complete");
}

0 个答案:

没有答案