Running garbageCollectTaskPersistence fails with deadlocked error
search cancel

Running garbageCollectTaskPersistence fails with deadlocked error

book

Article ID: 259637

calendar_today

Updated On:

Products

CA Identity Suite CA Identity Manager

Issue/Introduction

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."

Environment

All Identity Manager

Cause

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.

Resolution

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.