SEARCH THE COMMUNITY

Find an existing answer

2 results for “deadlock”

CommunityD365FO X++: When to use `while select forUpdate` vs optimistic concurrency to avoid deadlocksIn Dynamics 365 Finance and Operations (X++), what are the correct patterns for updating rows that are first selected inside a `while select` loop using `forUpdate` (or `selectForUpdate`), and how can I avoid deadlocks/lock escalation when multiple transactions update the same reCommunityWhy does an X++ select forUpdate deadlock when I update a related table inside the same loop? (locking order)In an X++ job (non-SSRS), I run a `while select forUpdate` over `TableA` and, for each record, I update a related record in `TableB` inside the loop. Intermittently, concurrent runs deadlock in SQL. I suspect the lock acquisition order is inconsistent across sessions because the