Applies to Product - Dynamics 365 Finance
What’s happening?
Customers experience deadlocks on database tables and batch jobs becoming stuck in a "Cancelling" status when attempting to post trade agreement journals, particularly when journals contain a large number of lines.
Reason:
This is caused by slow SQL execution related to custom extensions and batch jobs executing simultaneously at the same priority level, leading to performance degradation and batch jobs becoming stuck in a "Cancelling" state.
Resolution:
To resolve batch jobs stuck in "Cancelling" status and improve performance, follow these steps:
- Abort Stuck Batch Jobs:
- Enable the "Enhanced batch abort feature" in the Feature Management workspace.
- Navigate to System administration > Batch jobs.
- On the Batch tasks tab, select Abort on the batch job that is in the "Cancelling" state.
- For detailed instructions, refer to the following documentation: Cancel a running batch job - Finance & Operations | Dynamics 365 | Microsoft Learn.
- Optimize Batch Job Performance:
- Review and optimize any custom SQL queries or extensions that are causing slow execution. Work with your development team to optimize these queries.
- Specifically, investigate slow SQL queries related to custom extensions, such as queries involving tables like PRICEDISCADMTRANS and PRICEDISCADMTABLE, and optimize them accordingly.
- Priority-based Batch Scheduling:
- Evaluate and assign appropriate priority levels (e.g., Low, Normal, High, Critical, Reserved capacity) to batch processes to prevent simultaneous execution at the same priority level.
- For guidance on setting batch job priorities, refer to the following documentation: Priority-based batch scheduling - Finance & Operations | Dynamics 365 | Microsoft Learn.
- Enhanced Batch Abort Feature:
- Enable the "Enhanced batch abort feature" in the Feature Management workspace.
- Navigate to System administration > Batch jobs. On the Batch tasks tab, select "Abort" on the batch job that is in the "Cancelling" state.
