I'm uploading a file with 100,000 records with an asp:FileUpload control. The processing per record is pretty intense with a few DB calls per line. The problem I have is my process times out after about 20,000 records. However, I can get it to run all the way through when I'm debugging. Does anyone have any suggetions? Let me know if you need more info.
Also, why will it run without disruption in debugging mode?
Thanks.
KLSMCA10 pointsPosted Dec 4, 2008, 9:29 PM EST
Lets try one thing: before build the project
go to "Debug" option in visual studio->Exceptions->Managed Debugging Assistants->do "unchecked" ContextSwitchDeadlock.
gnarly7 pointsPosted Dec 5, 2008, 10:40 AM EST
There are no runtime errors and I made the configuration switch, but it still runs with no problems while debugging and errors out while not debugging. >.<
gnarly7 pointsPosted Dec 10, 2008, 5:57 AM EST
FYI - the Server.ScriptTimeout default value is 90 seconds. When you are debugging it is set to ~30,000,000 seconds (~350 days) so your page doesn't timeout. Overkill, right?
Anyway, I added an override on the Application_BeginRequest in the global.asax file of my web app and set the Server.ScriptTimeout value higher on the page that would handle the upload request.
<script language="C#" runat="server">void Application_BeginRequest(object source, EventArgs e)
{
if (Request.Path.ToUpper().Equals("/page.aspx"))
Server.ScriptTimeout = 7200; //2 hours
}
</script>