Question

SILAMBARASAN PANDIYAN on Wed, 01 Jun 2016 13:44:54


Hi,

I am getting request timed out error on Batch update using CSOM. Below is my code. Total records that will get updated is 21. Request body size is around 8 Kb. its getting timeout after 1.5 min.

4.2 kb of another request executes on 1.5 Seconds.

function SubmitToSPListBulk(listTitle, KeyValuePairObject) {
    $('.loading').show();
    UpdateFormDigest(_spPageContextInfo.webServerRelativeUrl, _spFormDigestRefreshInterval);
    var clientContext = new SP.ClientContext.get_current();
    var oList = clientContext.get_web()
        .get_lists()
        .getByTitle(listTitle);
    if (BidItemId > 0) {
        for (var i = 0; i < KeyValuePairObject.length; i++) {
            var listItem;
            if (KeyValuePairObject[i].ID <= 0) {
                var itemCreateInfo = new SP.ListItemCreationInformation();
                listItem = oList.addItem(itemCreateInfo);
            } else {
                listItem = oList.getItemById(KeyValuePairObject[i].ID);
            }
            for (var key in KeyValuePairObject[i]) {
                if (key !== "ID") {
                    listItem.set_item(key, KeyValuePairObject[i][key]);
                }
            }
            listItem.update();
            clientContext.load(listItem);
        }
        clientContext.executeQueryAsync(function () {
          
                $('.loading').hide();
            
        }, function (a, b) {
            $('.loading').hide();
            onQueryFailed(a, b);
        });
    }
}

Thanks and Regards,

Silambarasan


silambarasan.P

Replies

Jerry Zy on Thu, 02 Jun 2016 08:14:46


Hi SLAMB,

To narrow down this issue, I would suggest you can use Fiddler to trace the http web request for more detailed information.

Fiddler

Also, here is a demo about batch operations using JSOM, please refer:

Batch Operations using the JavaScript Client Object Model

Thanks

Best Regards

SILAMBARASAN PANDIYAN on Sat, 18 Jun 2016 11:10:21


I am doing the same thing that referred articles describe. Its not solving my issue. I had to write a custom REST service for batch Process. 

Thanks and Regards,

Silambarasan

Jerry Zy on Wed, 22 Jun 2016 02:35:01


Hi,

Thanks for your sharing.

Thanks

Best Regards


TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.