Skip to Content
avatar image
Former Member

Ajax throws "parsererror" & "SyntaxError: Unexpected end of JSON input" for Bulk Data Extract

Dear All,

Good Day.!

Am facing an Issue with Ajax call to REST Web Service.

It all Works as Expected up to 50k number of Data Extract from DB. But more than 50k Ajax throws Error,

"Error:parsererror" & "Error:SyntaxError: Unexpected end of JSON input"

Also i see the Data reaches upto REST from DB,,,

Below is the piece of code being used for,

getTableRecords : function(tableName, pkInput){ sap.ui.core.BusyIndicator.show(0); $ .ajax( { url : "/com.***~databrowser~rest~web/rest/DataBrowser/TableRecords/" + tableName, type : "POST", data : JSON.stringify(pkInput), dataType : 'json', contentType : "application/json;charset=utf-8", success : function(response) { if (response != undefined && response.tableRows.length > 0) { console.log("INZ:"+response.tableRows.length);***Code*** }, error : function(XMLHttpRequest, textStatus, errorThrown) { sap.ui.commons.MessageBox.show( "Error while getting Rows from Table " + tableName, "ERROR"); console.log("INZ:Error:"+errorThrown); } }); },

Please let Me know if why the Request fails for particularly bulk data extract ? and how this could be handled ?

Regards,

Nagishetty

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Aug 02, 2017 at 03:27 PM

    Maybe your db is timing out the request. Is pagination or filtering an option, 50k is a lot of data?

    Regards,

    Jamie

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 03, 2017 at 10:52 AM

    agree w Jamie - and this is pretty much the same answer for different platforms.. some alternative options would be to split your request if possible and get smaller chunks of data, however, the fundamental question would be.... do you really need that much data? and what are you doing w it on the application. a lot of end users say we need to see everything but often they do not understand what everything means - maybe you can suggest some filters, or a different load option such as odata which by default would make smaller request to service and bind to a table... if your scenario is to download data to a file, maybe even zip the file or consider a different method (ETL tool), scheduled file download, etc.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 03, 2017 at 10:52 AM

    agree w Jamie - and this is pretty much the same answer for different platforms.. some alternative options would be to split your request if possible and get smaller chunks of data, however, the fundamental question would be.... do you really need that much data? and what are you doing w it on the application. a lot of end users say we need to see everything but often they do not understand what everything means - maybe you can suggest some filters, or a different load option such as odata which by default would make smaller request to service and bind to a table... if your scenario is to download data to a file, maybe even zip the file or consider a different method (ETL tool), scheduled file download, etc.

    Add comment
    10|10000 characters needed characters exceeded