-2

I have tried by adding 10000 records in table, it is working fine for the same and able to add fetch without any error. But when tried to add more than 10000 records in the same table it is giving service time out error. As service itself is throwing timeout error. I dont't want to increase the timeout in web.config.

I am using Oracle SQL developer as a database engine and default connection string with entity framework.

I tried to add this piece of code in controller, but it is not working.

var result = this.Json(model, JsonRequestBehavior.AllowGet);
result.MaxJsonLength = int.MaxValue;
System.Web.HttpContext.Current.Server.ScriptTimeout = 300; 

This is the error i am getting while trying to add more than 10000 records

vivek
  • 21
  • 4
  • 2
    Maybe it's just bad design. How do you expect your user to pick between 10000 items? Let them type a few characters and then do search instead. – Palle Due Dec 08 '21 at 11:29
  • 1
    I agree with Palle - displaying that many records in a list is a terrible idea. Assume the end-user can scroll through 10 records per second. It would take them nearly **17 minutes** to scroll through a list of `10_000` items. Let the user search for the item they want instead. – Richard Deeming Dec 08 '21 at 11:39
  • I agree with Palle that it's probably not a good idea, but can you add your connection strings to the question? What database engine are you using? – Aaron P. Dec 08 '21 at 12:37
  • I am using Oracle SQL developer @AAP – vivek Dec 08 '21 at 13:24

1 Answers1

1

As you stated in your comment you are using an Oracle DB. The error you are getting is a timeout which will be defaulted to X by whatever database provider you are using.

If you are using .NET Framework 4.8 this link should help:

Another link which might help:

Here is the official documentation from Oracle:

Aaron P.
  • 188
  • 1
  • 11