Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Workflow deadlock error

(0) ShareShare
ReportReport
Posted on by 310
Hi,
 
All of a sudden we have started receiving deadlock errors on workflows for timesheets and expense reports.
 
 
The error states the following:
 
Stopped (error): X++ Exception: Cannot create a record in System user notifications (SystemNotificationUser). User ID: /user.name/, xxxxxxxxx.
Deadlock, where one or more users have simultaneously locked the whole table or part of it.
 at 
 
What could be causing this error?
  • Gaute K Profile Picture
    Gaute K 310 on at
    Workflow deadlock error
    Thanks for your suggestions.
     
    We have never had this issue before. It just recently appeared.
     
    We upgraded to a new version on 19.06, and I just discovered that the following batch job were created in that regard:
     
     
    As the deadlock refer to "SystemNotificationUser", could it be that one of these batch jobs is causing the issue?
  • Suggested answer
    Kevin Xia Profile Picture
    Kevin Xia Microsoft Employee on at
    Workflow deadlock error
    Hi,
    Before we can solve this problem, I think we need to know what a deadlock is and why it occurs. A deadlock is a phenomenon in which two or more processes are blocked during execution due to competition for resources or communication with each other, and they cannot proceed without external forces. At this time, the system is said to be deadlocked or the system has a deadlock, and these processes that are always waiting for each other are called deadlock processes. The main causes of deadlocks include:
    • insufficient system resources;
    • problems with the order in which the program is executed;
    • Improper allocation of resources, etc.
    Based on the above, I think this error may be caused by the following reason:
    • Concurrent processing: If many users trigger the workflows for timesheets and expense reports simultaneously, it can lead to concurrent access to the table, causing a deadlock error. This can happen in situations of high load or when processing a large number of timesheets and expense reports concurrently.
    • Database locks: The table is frequently accessed, and concurrent access to it can be impacted by database locks, especially during write operations. If locks are not released properly during workflow processing, it can result in deadlock errors.
    • Database performance issues: There may be database performance-related issues, such as unoptimized queries or indexing problems, that can slow down database processing and lead to deadlock issues in scenarios of concurrent access.
    Some possible approaches to resolve this error include:
    • If feasible, try reducing the number of concurrent processing, such as by adjusting the workflow triggering conditions or using a queuing mechanism to limit the number of workflows processed simultaneously.
    • Ensure database performance optimization. Consider optimizing the database by checking and fixing query or indexing issues to improve processing speed and reduce the risk of database locking.
    • Review the workflows for timesheets and expense reports to identify any potential areas where multiple processes might be accessing the same data simultaneously. Look for dependencies or parallel execution paths that could lead to conflicts.
    Best regards,
    Kevin
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 292,160 Super User 2025 Season 1 on at
    Workflow deadlock error
    Hi Gaute,
     
    From your question, I think to understand you didn't had this issue before. Do you know if something got changed? Was there a Microsoft update installed or another code deployment on this environment? Did you start using other processes, more companies or more users? Are there new batch processes added? When you resume the workflow, does it then get propertly processed or is it then for the same work item failing again?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,160 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans