Tracking Down SQL Lock Request Timeout

I am trying to track down the root cause of Epicor throwing a SQL lock time out for a specific record in a UD table, but I am unsure where to look next. There was an extremely similar error previously that referenced a BPM, but I disabled it and still got these errors:

Server side errors:

Query failed to run
System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while reading from the store provider's data reader. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Lock request time out period exceeded.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows)
   at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)
   at System.Data.SqlClient.SqlDataReader.Read()
   at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.StoreRead()
   --- End of inner exception stack trace ---
   at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.HandleReaderException(Exception e)
   at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.StoreRead()
   at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at System.Data.Entity.Core.Objects.CompiledQuery.ExecuteQuery[TResult](ObjectContext context, Object[] parameterValues)
   at System.Data.Entity.Core.Objects.CompiledQuery.Invoke[TArg0,TArg1,TResult](TArg0 arg0, TArg1 arg1)
   at Epicor.Data.DBExpressionCompiler.<>c__DisplayClass33_1`3.<Compile>b__3(TContext c, Func`3 query) in C:\_Releases\ICE\ICE3.2.400.28\Source\Framework\Epicor.System\Data\DBExpressionCompiler.Generated.cs:line 1089
   at Epicor.Data.DBExpressionCompiler.GetResult[TDataContext,TQuery,TResult](Func`3 executeQuery, Cache cacheSetting, TDataContext dataContext, TQuery query) in C:\_Releases\ICE\ICE3.2.400.28\Source\Framework\Epicor.System\Data\DBExpressionCompiler.cs:line 445
   at Epicor.Data.DBExpressionCompiler.InvokeSingle[TDataContext,TQuery,TResult](Expression expression, Cache currentCacheSetting, Boolean cacheQuery, TDataContext dataContext, Func`2 getDataCacheKey, Func`2 compileQuery, Func`3 executeQuery) in C:\_Releases\ICE\ICE3.2.400.28\Source\Framework\Epicor.System\Data\DBExpressionCompiler.cs:line 301
(context, sysRowID_ex) => context.UD102.With(UpdLock).Where(row => (row.SysRowID == sysRowID_ex)).FirstOrDefault()



System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while reading from the store provider's data reader. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Lock request time out period exceeded.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows)
   at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)
   at System.Data.SqlClient.SqlDataReader.Read()
   at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.StoreRead()
   --- End of inner exception stack trace ---
   at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.HandleReaderException(Exception e)
   at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.StoreRead()
   at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at System.Data.Entity.Core.Objects.CompiledQuery.ExecuteQuery[TResult](ObjectContext context, Object[] parameterValues)
   at System.Data.Entity.Core.Objects.CompiledQuery.Invoke[TArg0,TArg1,TResult](TArg0 arg0, TArg1 arg1)
   at Epicor.Data.DBExpressionCompiler.<>c__DisplayClass33_1`3.<Compile>b__3(TContext c, Func`3 query) in C:\_Releases\ICE\ICE3.2.400.28\Source\Framework\Epicor.System\Data\DBExpressionCompiler.Generated.cs:line 1089
   at Epicor.Data.DBExpressionCompiler.GetResult[TDataContext,TQuery,TResult](Func`3 executeQuery, Cache cacheSetting, TDataContext dataContext, TQuery query) in C:\_Releases\ICE\ICE3.2.400.28\Source\Framework\Epicor.System\Data\DBExpressionCompiler.cs:line 445
   at Epicor.Data.DBExpressionCompiler.InvokeSingle[TDataContext,TQuery,TResult](Expression expression, Cache currentCacheSetting, Boolean cacheQuery, TDataContext dataContext, Func`2 getDataCacheKey, Func`2 compileQuery, Func`3 executeQuery) in C:\_Releases\ICE\ICE3.2.400.28\Source\Framework\Epicor.System\Data\DBExpressionCompiler.cs:line 306
   at Epicor.Data.DBExpressionCompiler.<>c__DisplayClass33_0`3.<Compile>b__0(TContext context, TArg1 arg1) in C:\_Releases\ICE\ICE3.2.400.28\Source\Framework\Epicor.System\Data\DBExpressionCompiler.Generated.cs:line 1082
   at Ice.Tables.UD102.FindFirstBySysRowIDWithUpdLock(IceContext dataContext, Guid sysRowID) in C:\_Releases\ICE\ICE3.2.400.0\Source\Server\Db\Ice.Data.Model\IceContext.Model.cs:line 239962
   at Ice.Services.BO.UD102Svc.GetDBRowWithUpdLock(Int32 tableNumber, Guid rowID) in C:\_Releases\ICE\ICE3.2.400.0\Source\Server\Services\BO\UD102\UD102.Designer.cs:line 212
   at Ice.TablesetBound`3.UpdateRow(IceDataContext dataContext, Int32 tableNum, IIceTable table, IceRow updatedRow, IceRow originalRow, IColumnUncensor uncensor, TablesetProfilingCollector parentTraceCollector) in C:\_Releases\ICE\ICE3.2.400.28\Source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 1250
   at Ice.TablesetBound`3.WriteTable(IceDataContext dataContext, Int32 tableIndex, IIceTable table, TablesetProfilingCollector parentTraceCollector) in C:\_Releases\ICE\ICE3.2.400.28\Source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 974
   at Ice.TablesetBound`3.InnerUpdate[TUpdater](IceDataContext dataContext, TFullTableset tableset) in C:\_Releases\ICE\ICE3.2.400.28\Source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 866
   at Ice.Services.BO.UD102Svc.Update(UD102Tableset& ds) in C:\_Releases\ICE\ICE3.2.400.0\Source\Server\Services\BO\UD102\UD102.Designer.cs:line 977
   at Ice.Services.BO.UD102SvcFacade.Update(UD102Tableset& ds) in C:\_Releases\ICE\ICE3.2.400.0\Source\Server\Services\BO\UD102\UD102SvcFacade.cs:line 644
   at SyncInvokeUpdate(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func`2 func) in C:\_Releases\ICE\ICE3.2.400.28\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59
   at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func`2 func) in C:\_Releases\ICE\ICE3.2.400.28\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 28

Any help would be greatly appreciated.

To help the community provide the best answer, could you include as much of the information below as you can? Your question appears to be lacking some much needed context


  • Epicor Version
  • Deployment Type (Cloud, On Prem, 3rd Party Cloud etc)
  • The business problem you’re trying to solve
  • What you’ve already tried
  • Is this a Kinetic UX (Web) or Epicor Classic issue?
  • Is it related to a Method Directive, Data Directive, Function, BAQ, UBAQ, Configurator, etc.?
  • Any screenshots, error messages, or logs.
  • Any code you’ve written (or borrowed , make sure it is property formatted)
    ```
    code here
    ```
  • Steps to reproduce the issue

For tips on how to ask questions effectively, check out this guide:
Tips for Asking Questions on the Forum
clippy-hi

Going to reiterate @Banderson

we really need to know more about this UD table, any directives (method or data, customisation) that may be related.

I see you are On-Prem. Have you taken a look with SQL profiler to get an idea what SQL is running prior to the error…