Last post May 18, 2017 05:19 PM by PatriceSc
May 18, 2017 02:19 PM|Vivekgvivi1986|LINK
I have developed a web application which inserts records into PL/SQL using below code
trans_status = myDataAdapter.Update(ds, "LoadedTable");
The above update process takes around 30 minutes to complete the process.
All the code after "myDataAdapter.Update(ds, "LoadedTable");" gets executed without any issues but still, the page is not get refreshed. The web page keeps on waiting and it never gives a message "Loaded Successfully".
All above happens on click of a button.
Step 1: Loads records from SQL server.[which takes around 14 sec] Step 2. Insert all records fetched from SQL to oracle using myDataAdapter.Update(ds, "LoadedTable") [which takes around 30 minutes] Step 3: Email notification to user [I am getting email notification]
transtatus = myDataAdapter.Update(ds, "LoadedTable");
if (transtatus == -1)
sql.SendStatusEmail("email@example.com", "Transaction Failed");
Step 4: Update some of the SQL tables with success/failure [All tables get updated successfully] Step 5: Display the success message in label [Not showing anything as page is kept on waiting]
if (TranSuccess == true)
lblMsg.Text = "Transation Successfull";
lblMsg.Visible = true;
Step 6: Load the grid with fresh records from SQL
Gridview bind in the last step in the click event.
In order to make sure the control is coming to the last statement I wrote a code to log some details into a plain text after gvProcessedFileList.DataBind(); , and I could able to find the result as well.
When I debug it works as expected, but When I deploy the code in the server only I am experiencing this problem.
Kindly help me to resolve the issue.
May 18, 2017 05:19 PM|PatriceSc|LINK
It seems a regular method call rather than really a "background process". So if the call takes 30 minutes, it will take 30 minutes for the server side code to reach the line of code that follows this myDataAdapter.Update(ds, "LoadedTable") call.
My approach would be :
- to "queue" that request (maye to some table) so that the page will just immediately complete telling the user he'll get a mail or web site notification once done
- I wouldn't do that using the web server. You are moving massive data from SQL Server to the web server to Oracle while it might be possible to move them more efficiently directly from SQL Server to Oracle
- then when completed you could send a mail or if the user is still browsing the site you could show him a notfication that the work is completed
For now my guess is that it doesn't happen on your dev box because you just process much less data ?
Edit: humm it really takes 14 seconds to read data from SQL Server and 30 minutes to write the same data to Oracle ??? There is likely something wrong in your time measurement...
Edit 2: BTW a well know issue is trying to show hundreds if not thousands of rows on a web page. Showing a huge HTML page takes time to download and render in the browser and then it's hard for a user to find which rows he actually want to see among all