Running Cleanup Submitted Task stored procedure garbageCollectTaskPersistence fails with below error:
"Transaction was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction."
All Identity Manager
The garbageCollectTaskPersistence stored procedure is used when you just want to delete records from the Task Persistence database tables.
The archiveTaskPersistence stored procedure is used when you want to not only delete records from the Task Persistence tables but also insert them into the Archive database tables.
Running both procedures during overlapping times can lead to lock error since both could be trying to operate on same items.
Do not run both procedures at overlapping time. Really there is no reason to use the garbageCollectTaskPersistence stored procedure if you are doing the Archiving with the archiveTaskPersistence stored procedure anyways.
When you want to remove the records from the Archive database tables you can run the archive_gcTaskPersistence stored procedure but again do not run it overlapping with another procedure.