Deadlock when using Job Queues

gpdiat
Member Posts: 13
Hello i am having a problem related to Job Queues and i would very much appreciate it if you could help me out.
Here is the problem:
I have created two separate Job Queues:

And their cards:

The first Job Queue is created for running a Codeunit every 3 minutes and the second for running a report once every day.

The problem is that every once in a while, for some unknown reason the second Job Queue stops and i have to restart it. I dont undestand why this is happening. The error in the event viewer is the following:
Both Job Queues run with the same user, who is a SUPER user.
The only thing i have noticed is that the error happens while the first Job Queue is running. I dont understand why those two Job Queues have a conflict with each other, since i have configured the first Job Queue Entry to run until 9pm and the second to run only every day at 10pm. Why does the message say that another user is modifying the Job Queue Entry table, since those two Jobs never run at the same time?
Any help would be very much appreciated!
Here is the problem:
I have created two separate Job Queues:

And their cards:


The first Job Queue is created for running a Codeunit every 3 minutes and the second for running a report once every day.


The problem is that every once in a while, for some unknown reason the second Job Queue stops and i have to restart it. I dont undestand why this is happening. The error in the event viewer is the following:
Log Name: Application Source: MicrosoftDynamicsNavServer$DynamicsNAV71 Date: 16/9/2015 12:10:46 μμ Event ID: 216 Task Category: (13) Level: Error Keywords: Classic User: N/A Computer: proderp.icap.gr Description: Server instance: DynamicsNAV71 Tenant ID: default Session type: Background Session ID: 3082 User: ICAP\DYNAMIC Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavCSideException Remappable: True ErrorCode: 22926089 ErrorNumber: 54025 ModuleNumber: 93 SuppressMessage: False FatalityScope: None Message: Your activity was deadlocked with another user modifying the Job Queue Entry table. StackTrace: at Microsoft.Dynamics.Nav.Runtime.RecordImplementationHelper.MapException(NavCSideException originalException, NCLMetaTable metaTable, IRecordBuffer recordBuffer, Boolean makeNewExceptionRemappable) at Microsoft.Dynamics.Nav.Runtime.RecordImplementation.IssueFindRequest(DataError errorLevel, Boolean reversed, FindType findType, Boolean useCache) at Microsoft.Dynamics.Nav.Runtime.RecordImplementation.FindFirstRecord(DataError errorLevel) at Microsoft.Dynamics.Nav.Runtime.NavRecord.ALFindFirst(DataError errorLevel) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit448.GetNextRequest_Scope.OnRun() at Filter.InvokeWithFilter(NavMethodScope ) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit448.GetNextRequest(INavRecordHandle jobQueueEntry) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit448.HandleRequest_Scope.OnRun() at Filter.InvokeWithFilter(NavMethodScope ) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit448.JobQueueLoop_Scope.OnRun() at Filter.InvokeWithFilter(NavMethodScope ) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit448.OnRun_Scope.OnRun() at Filter.InvokeWithFilter(NavMethodScope ) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit448.OnRun(INavRecordHandle εrec) at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.DoRun(DataError errorLevel, NavRecord record) at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.InvokeRun(Int32 objectId, Object[] args) at Microsoft.Dynamics.Nav.Runtime.ALSession.RunCodeunitAndDisposeSession(NavSession session, Int32 codeUnitId, NavRecord record) Source: Microsoft.Dynamics.Nav.Ncl HResult: -2146233088 ---------------------------------- Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavCSideException Remappable: True ErrorCode: 22926089 ErrorNumber: 54025 ModuleNumber: 93 SuppressMessage: False FatalityScope: None Message: Your activity was deadlocked with another user modifying the Job Queue Entry table. StackTrace: at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.CheckAndthrowTrapableErrors(Int32 errorNumber, NavSqlException navSqlException) at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.MapException(SqlException exception, NavSqlCommand command) at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.ExecuteFunction[T](Func`1 function, NavSqlCommand command) at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.ExecuteFunctionWithTrace[T](EventTask task, Func`1 function, NavSqlCommand command) at Microsoft.Dynamics.Nav.Runtime.NavSqlCommand.ReadNextRow() at Microsoft.Dynamics.Nav.Runtime.NavSqlIsamQueryCommand.ExecuteFindTop(FilterExpression filter, Boolean onlyCurrentKeyFieldsNeeded) at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.ExecuteCommandAndCacheOnSuccess[T](NavSqlCommandCacheKey commandKey, Func`1 createFunc, Func`2 executeFunc) at Microsoft.Dynamics.Nav.Runtime.NavSqlIsamQueryCommand.FindTop1(NavDatabase database, NCLMetaTable table, Int32 companyIndex, Byte findMethod, Boolean locking, Boolean onlyCurrentKeyFieldsNeeded, FieldList orderByFields, FilterExpression filter) at Microsoft.Dynamics.Nav.Runtime.NavSqlIsamQueryCommand.FindTop1(NavDatabase database, PositionedFindProviderRequest request, Boolean onlyCurrentKeyFieldsNeeded) at Microsoft.Dynamics.Nav.Runtime.SqlTableDataProvider.TableFindFromPosition(NCLMetaTable table, PositionedFindProviderRequest request, Func`1 onlyCurrentKeyNeededForNextRow) at Microsoft.Dynamics.Nav.Runtime.DataAccess.InnerFind(FindCacheRequest request, Boolean fromPosition, Func`1 onlyCurrentKeyNeededForNextRow) at Microsoft.Dynamics.Nav.Runtime.RecordImplementation.IssueFindRequest(DataError errorLevel, Boolean reversed, FindType findType, Boolean useCache) Source: Microsoft.Dynamics.Nav.Ncl HResult: -2146233088 Event Xml: <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> <System> <Provider Name="MicrosoftDynamicsNavServer$DynamicsNAV71" /> <EventID Qualifiers="0">216</EventID> <Level>2</Level> <Task>13</Task> <Keywords>0x80000000000000</Keywords> <TimeCreated SystemTime="2015-09-16T09:10:46.000000000Z" /> <EventRecordID>494072</EventRecordID> <Channel>Application</Channel> <Computer>proderp.icap.gr</Computer> <Security /> </System> <EventData> <Data>Server instance: DynamicsNAV71 Tenant ID: default Session type: Background Session ID: 3082 User: ICAP\DYNAMIC Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavCSideException Remappable: True ErrorCode: 22926089 ErrorNumber: 54025 ModuleNumber: 93 SuppressMessage: False FatalityScope: None Message: Your activity was deadlocked with another user modifying the Job Queue Entry table. StackTrace: at Microsoft.Dynamics.Nav.Runtime.RecordImplementationHelper.MapException(NavCSideException originalException, NCLMetaTable metaTable, IRecordBuffer recordBuffer, Boolean makeNewExceptionRemappable) at Microsoft.Dynamics.Nav.Runtime.RecordImplementation.IssueFindRequest(DataError errorLevel, Boolean reversed, FindType findType, Boolean useCache) at Microsoft.Dynamics.Nav.Runtime.RecordImplementation.FindFirstRecord(DataError errorLevel) at Microsoft.Dynamics.Nav.Runtime.NavRecord.ALFindFirst(DataError errorLevel) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit448.GetNextRequest_Scope.OnRun() at Filter.InvokeWithFilter(NavMethodScope ) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit448.GetNextRequest(INavRecordHandle jobQueueEntry) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit448.HandleRequest_Scope.OnRun() at Filter.InvokeWithFilter(NavMethodScope ) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit448.JobQueueLoop_Scope.OnRun() at Filter.InvokeWithFilter(NavMethodScope ) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit448.OnRun_Scope.OnRun() at Filter.InvokeWithFilter(NavMethodScope ) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit448.OnRun(INavRecordHandle εrec) at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.DoRun(DataError errorLevel, NavRecord record) at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.InvokeRun(Int32 objectId, Object[] args) at Microsoft.Dynamics.Nav.Runtime.ALSession.RunCodeunitAndDisposeSession(NavSession session, Int32 codeUnitId, NavRecord record) Source: Microsoft.Dynamics.Nav.Ncl HResult: -2146233088 ---------------------------------- Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavCSideException Remappable: True ErrorCode: 22926089 ErrorNumber: 54025 ModuleNumber: 93 SuppressMessage: False FatalityScope: None Message: Your activity was deadlocked with another user modifying the Job Queue Entry table. StackTrace: at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.CheckAndthrowTrapableErrors(Int32 errorNumber, NavSqlException navSqlException) at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.MapException(SqlException exception, NavSqlCommand command) at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.ExecuteFunction[T](Func`1 function, NavSqlCommand command) at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.ExecuteFunctionWithTrace[T](EventTask task, Func`1 function, NavSqlCommand command) at Microsoft.Dynamics.Nav.Runtime.NavSqlCommand.ReadNextRow() at Microsoft.Dynamics.Nav.Runtime.NavSqlIsamQueryCommand.ExecuteFindTop(FilterExpression filter, Boolean onlyCurrentKeyFieldsNeeded) at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.ExecuteCommandAndCacheOnSuccess[T](NavSqlCommandCacheKey commandKey, Func`1 createFunc, Func`2 executeFunc) at Microsoft.Dynamics.Nav.Runtime.NavSqlIsamQueryCommand.FindTop1(NavDatabase database, NCLMetaTable table, Int32 companyIndex, Byte findMethod, Boolean locking, Boolean onlyCurrentKeyFieldsNeeded, FieldList orderByFields, FilterExpression filter) at Microsoft.Dynamics.Nav.Runtime.NavSqlIsamQueryCommand.FindTop1(NavDatabase database, PositionedFindProviderRequest request, Boolean onlyCurrentKeyFieldsNeeded) at Microsoft.Dynamics.Nav.Runtime.SqlTableDataProvider.TableFindFromPosition(NCLMetaTable table, PositionedFindProviderRequest request, Func`1 onlyCurrentKeyNeededForNextRow) at Microsoft.Dynamics.Nav.Runtime.DataAccess.InnerFind(FindCacheRequest request, Boolean fromPosition, Func`1 onlyCurrentKeyNeededForNextRow) at Microsoft.Dynamics.Nav.Runtime.RecordImplementation.IssueFindRequest(DataError errorLevel, Boolean reversed, FindType findType, Boolean useCache) Source: Microsoft.Dynamics.Nav.Ncl HResult: -2146233088 </Data> </EventData> </Event>
Both Job Queues run with the same user, who is a SUPER user.
The only thing i have noticed is that the error happens while the first Job Queue is running. I dont understand why those two Job Queues have a conflict with each other, since i have configured the first Job Queue Entry to run until 9pm and the second to run only every day at 10pm. Why does the message say that another user is modifying the Job Queue Entry table, since those two Jobs never run at the same time?
Any help would be very much appreciated!
0
Comments
-
The Job Queue runs continuously as it checks for something to do. It's only the task (Job Queue Entries) that run only when scheduled.
Setup SQL Extended Events to log information about the deadlocks. This will identify the offending SQL statements and help you to isolate the issue.There are no bugs - only undocumented features.0 -
Thank you bbrown. I'll try what you are suggesting and post my findings.0
-
did you find a solution for this?
0 -
I'm curious too..."Money is likewise the greatest chance and the greatest scourge of mankind."0
-
Facing the same issue. Can anyone help me out over her. Having Nav 2015 version0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions