Views:

Applies to Product - Dynamics 365 Business Central


What’s happening?
Experiencing frequent deadlock errors when posting bank deposits containing a large number of lines (e.g., 10,000 lines). This issue causes significant delays in processing, with posting times exceeding 30 minutes, and prevents other users from posting transactions simultaneously.
 

Reason:
The deadlock issues are attributed to lengthy posting times and simultaneous user activity, particularly when multiple users attempt to post transactions concurrently. The performance profiler indicates that the custom code unit is taking longer than expected during these operations.
 

Resolution:

  1. Testing in Sandbox: It is recommended to test the posting process in a sandbox or a copy of the production environment without any custom extensions to determine if the issue persists.
  2. Performance Profiler: Share the performance profiler results for the deposit transaction to analyze the performance and identify bottlenecks.
  3. Transaction Count Reduction: Consider reducing the number of lines in each transaction to avoid database locks and improve performance.
  4. Job Scheduling: Explore the possibility of scheduling job queues for posting transactions during non-business hours to minimize the impact on daily operations.
  5. Indexing: Investigate if indexing can be implemented to enhance performance in the current environment.
If further details or observations are available, they should be shared to assist in diagnosing and addressing the issue effectively.