2 Datatables with Ajax throwing Ajax error for datasets over certain size

2 Datatables with Ajax throwing Ajax error for datasets over certain size

tomzntomzn Posts: 29Questions: 9Answers: 2

My scenario is as follows :

  1. I have 2 datatables on my page that each obtain their datasets via an ajax request to the server the first time they load. Each datatable has its own url for ajax request.

  2. The first datable loads fine with +/- 600 records. I have not tried it with more.

  3. The second one loads fine with up to 650 records. If a dataset with more than 650 records is passed to the datatable I get the 'Ajax error' i.e. tn/7
  4. I have deferred render set to true.

How do I get around this issue ? I know that client side processing can handle many more than 10000 records so I cannot understand why I am getting this error for such a small dataset. I have tried to obtain the last json dataset that's passed to the client . The last json response is {"C":"d-77390DCB-CZ,0|Co,D|Cp,0","M":[]}

Thanks in advance.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin

    We'd really need a link to the page showing the issue to be able to help debug it, or more information. For example, what is the status code returned from the server for each Ajax request? What is the data in each Ajax request? Does the server's error log show any informaiton?

    Allan

  • tomzntomzn Posts: 29Questions: 9Answers: 2

    Hi Allan,

    Thanks for the response. Information logged to the console is below.

    XHR Loaded (LoadCustomers - 200 OK - 1.0251849999995102s - 898.179KB)
    VM303:3 http://localhost:3456/Profile/LoadCustomers?   q=DDrgKXZzqmo%3D&_=1481184299568
    VM304:3 Time over 1000ms(anonymous function) @ VM304:3(anonymous function)  @ VM304:4
    
     VM305:3 Object {startedDateTime: "2016-12-08T08:04:59.870Z", time:    1025.1849999995102, request: Object, response: Object, cache: Object…}
    jquery-2.2.0.js:9172 GET http://localhost:3456/Profile/LoadAccounts?  q=RqyTt55jSfZQbu5VckN%2Bog%3D%3D&_=1481184299569 500 (Internal Server   Error)
    
    XHR Loaded (LoadAccounts - 500 Internal Server Error - 11.74410799999987s - 12.062KB)
    VM309:3 http://localhost:3456/Profile/LoadAccounts?q=RqyTt55jSfZQbu5VckN%2Bog%3D%3D&_=1481184299569
    VM310:3 Time over 1000ms(anonymous function) @ VM310:3(anonymous function) @ VM310:4
    VM311:3 Object {startedDateTime: "2016-12-08T08:04:59.884Z", time: 11744.10799999987, request: Object, response: Object, cache: Object…}
    
  • tomzntomzn Posts: 29Questions: 9Answers: 2
    Answer ✓

    Hi all,

    After doing some more debugging and checking around I have realized the following :

    1. The issue is due to the dataset being larger than the default value configured in ASP.NET MVC.

    2. Changing the maximum json length in the controller method solved the problem.

    These links explain in more detail :
    stackoverflow.com/questions/15288367/increase-json-response-maxjsonlength-in-mvc-4

    stackoverflow.com/questions/1151987/can-i-set-an-unlimited-length-for-maxjsonlength-in-web-config/1151993#1151993

    Once again, thanks for looking at my question and replying.

    Cheers

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin

    Thanks for posting back.. Great to hear that you've found the issue and the solution.

    Allan

This discussion has been closed.