web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Workflow deadlock error

(0) ShareShare
ReportReport
Posted on by 314
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?
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    299,923 Super User 2025 Season 2 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?
  • Suggested answer
    Kevin Xia Profile Picture
    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
  • Gaute K Profile Picture
    314 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?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 683 Super User 2025 Season 2

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 620

#3
Martin Dráb Profile Picture

Martin Dráb 563 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans