in Education by
I have a web page that accepts an excel file, reads data from it and stores it in a buffer table. Then a procedure is called that reads from this buffer table and each record passes through number of validations. After procedure completes, I delete the buffer table contents from code behind. I have executed this code using about 100 records and it executes in a few seconds. However, when the record size is increased (say about 2000), the procedure takes over 5 mins to execute, but the web page hangs. I have checked the table, the record insertion and buffer table deletion takes about 6-7 mins, but the web page does not return a result even after 30 mins. I have tried to optimize the procedure, but still in case of large number of records the web page hangs. Please give me some direction as to how to avoid this page hanging situation. Any help would be great. Thanks in advance JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I think that the first thing you should do is wrap your inserts into a transaction. If there are too many records for a single transaction, you could perform a commit every n records (say 500). As far as the web page returning, you could be reaching a timeout of some sort where IIS or the client abandons the request or if you update the page with data, you could have invalid data which is causing errors in the page. For this, you should check the windows event log to see if IIS or ASP.Net are reporting any exceptions. You can also run fiddler to see what is happening to the request. Finally, I would strongly suggest a redesign that does not require the user to wait with a submitted form on the screen until processing is complete. The standard pattern that we use for this type of functionality is to record incoming requests in the database with a GUID, kick off a background worker to perform the task, and return the GUID to the client. When the background worker has finished (or encounters an error), it updates the request table in the database with the new status (i.e. success or fail) and the error message if any. The client can use the GUID to issue ajax requests to the web server on a regular basis (using window.timeout so as not to block the user and allow animations to be displayed) to determine whether or not the process is complete. Once the process is complete, the UI can be updated as needed. Update To record incoming requests in the database with a GUID, create a table that contains a GUID column as the primary key, a status column (3 values: in progress, success, failure), and an error message column. When the request is received, create a new GUID in your code, then write a record to this new table with this GUID and a status of in progress prior to launching the background worker. You will pass the GUID to the background worker so that it can update the table on completion (it just updates that status to complete or error and records the error message, if any). You will also pass the GUID back to the client through javascript so that the client can periodic ask the web server to perform a query against the table using the GUID to determine when the request is no longer in progress.

Related questions

0 votes
    I'm writing an app for Android in Xamarin Forms. I want to navigate the user from one page to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    I'm writing an app for Android in Xamarin Forms. I want to navigate the user from one page to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    I'm writing an app for Android in Xamarin Forms. I want to navigate the user from one page to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    Is there any simple way to repeat code in a try/catch block after an exception occurs without using method ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 1, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Set default home page via in JSF project (3 answers) Closed 5 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    I'm having some trouble recently. On a WebForm I declare a static object, like this : public static ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    I'm having some trouble recently. On a WebForm I declare a static object, like this : public static ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    I'm having some trouble recently. On a WebForm I declare a static object, like this : public static ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    Explain differences between the page execution lifecycle of an ASP.NET page and an ASP.NET AJAX page?...
asked Dec 31, 2020 in Technology by JackTerrance
0 votes
    The number of cycles a wave completes in one second is called? (a) time period (b) frequency (c) energy (d ... for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 20, 2021 in Education by JackTerrance
0 votes
    A sine wave completes half cycle in ____ radians. (a) π/2 (b) π (c) π/4 (d) 2π I got this ... theory Questions for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 19, 2021 in Education by JackTerrance
0 votes
    A sine wave completes quarter cycle in ____ radians. (a) 2π (b) π (c) π/2 (d) π/4 The question ... Questions for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 19, 2021 in Education by JackTerrance
0 votes
    A sine wave completes full cycle in ____ radians. (a) π (b) 2π (c) π/4 (d) π/2 I had been ... theory Questions for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 19, 2021 in Education by JackTerrance
0 votes
    Do Web services supports Remote Procedure Calls(RPCs)?...
asked Nov 7, 2020 in Education by Editorial Staff
0 votes
    Suppose you have three Jobs of which Jobs 1 and 2 are executed parallelly. Job 3 executes only after Jobs 1 and ... can be used to set this up? tUnite tPostJob tRunJob tParallelize...
asked Mar 24, 2021 in Technology by JackTerrance
...