In this section of the documentation is explains that if the Task Persistence and Archive are both on different databases,
then you should uncheck the Cleanup via Stored Procedure Box
It is explained below in the documentation
https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/layer7-identity-and-access-management/identity-manager/14-3/administrating/system-management/cleanup-submitted-tasks/cleanup-submitted-tasks-tab.html