SQL exception. Exception Message: Timeout expired

jimmylew52
jimmylew52 used Ask the Experts™
on
I have a dot net 4  64 bit application that freezes the application when this occurs. Occurs when a large file is sent to the database.

Any ideas on what to do to prevent this. Any help would be appreciated.

EventID:  1309
Event code: 3005
Event message: An unhandled exception has occurred.

Process information:
    Process ID: 4136
    Process name: w3wp.exe
    Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
    Exception type: SqlException
    Exception message: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
   at Systrends.eFileEQR.Business.FilingImport.ExcelFileProcessor.SaveFilingEQRDataToDB(eFileEQRExcelDataModel eFileEQRExcelData, String fileName, String uniqueId, FilingModel filingModel, UserModel userModel, FilingModificationOptionsModel filingModificationOptionsModel, String userRole, Int32 filingAgentId)
   at Systrends.eFileEQR.Controllers.FilingImportController.SaveSlickGridEQRData(DataSourceRequest request, String fileNamesJsonString, String idDataJson, String contractDataJson, String transactionDataJson, String indexPriceDataJson, String filingImportOptions, Int32 filingId, Int32 filingAgentId, Boolean skipWarnings, Boolean showValidationHint)
   at lambda_method(Closure , ControllerBase , Object[] )
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<>c__DisplayClass2a.<BeginInvokeAction>b__20()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
   at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
   at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Thread information:
    Thread ID: 27
    Thread account name: NT AUTHORITY\NETWORK SERVICE
    Is impersonating: False
    Stack trace:    at Systrends.eFileEQR.Business.FilingImport.ExcelFileProcessor.SaveFilingEQRDataToDB(eFileEQRExcelDataModel eFileEQRExcelData, String fileName, String uniqueId, FilingModel filingModel, UserModel userModel, FilingModificationOptionsModel filingModificationOptionsModel, String userRole, Int32 filingAgentId)
   at Systrends.eFileEQR.Controllers.FilingImportController.SaveSlickGridEQRData(DataSourceRequest request, String fileNamesJsonString, String idDataJson, String contractDataJson, String transactionDataJson, String indexPriceDataJson, String filingImportOptions, Int32 filingId, Int32 filingAgentId, Boolean skipWarnings, Boolean showValidationHint)
   at lambda_method(Closure , ControllerBase , Object[] )
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<>c__DisplayClass2a.<BeginInvokeAction>b__20()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
   at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
   at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Increase you Timeout in your Dot Net Connection to the Database. May be the database needs more time to do process the large file you are sending.

Author

Commented:
Need more information, how would I do that. I an pretty much .net ignorant. I cannot convince our dot net guys this is s problem and they will not help me.

In Web.config file in the application folder is see this:

 <sessionState mode="InProc" timeout="120" />

If I increase this time will that help?
Top Expert 2016

Commented:
Yes that is the value you need to increase from 120 seconds .. try adding another minute change it to 180
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

AndyAinscowFreelance programmer / Consultant

Commented:
Just for more information - how do you define 'large file' ?
10GB, 1 GB, 100MB, 10MB, 1MB, 100KB ....

Author

Commented:
11 MB, 83,000 rows of data
Top Expert 2012
Commented:
Your ,NET developers need to increase the timeout for the query in the code (there is nothing you can do in the config) from the default 30 seconds.  In other words, if the query does not complete in 30 seconds it will timeout.  To avoid that happening you have two choices (in preferred order):
1. Optimize the hardware and/or software (including the query itself).
2. Increase the CommandTimeout property in the code for this connection.

Author

Commented:
Still waiting on the development team to make changes.

I believe your answers are correct.

Author

Commented:
Thanls for your input

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial