We have a workflow that auto approves timesheets. We may get hundres of these at a time. In testing when more than 100 timesheets are "in review" this has resulted in deadlocks causing the workflow step to fail with errors like:
"Stopped (error): Cannot edit a record in Subledger journal entry (SubledgerJournalEntry). Ledger: 0, Current.
Deadlock, where one or more users have simultaneously locked the whole table or part of it."
What I noticed is that the batch job that runs sysworkflowmessagequeuemanager kicks of a task called sysworkflowqueuetask. When there are more than one hundres workflows to process it kicks off 2 of them. I'm guessing that they are both then trying to approve and post timecards simultaneously and causing the deadlock. I can reproduce this issue and as long as I control the flow of new timecards the process runs without error.
So question is, does anyone know of a way to tell sysworkflowmessagequeuemanager not to run more thanone instance of sysworkflowqueuetask?
I found one article which suggests that the workflow process works in batches of 100 which put me onto this, but I can't find anything more.
Any help would be much appreciated.
PeterA
*This post is locked for comments
I have the same question (0)