We've implemented following within an ADS dialog to manage index deadlock situations where updates are occurring on a particular record type (PT-PK-SGNOUT-REC) owned by 5 system owned indexes (don't ask)
ACCEPT DB-KEY INTO PT-WK-D431-DBKEY
FROM PT-PK-SGNOUT-REC CURRENCY.
MODIFY PT-PK-SGNOUT-REC ALLOWING (DB-DEADLOCK).
SNAP RECORD (PT-PK-SGNOUT-REC)
TITLE 'PTELD431 - DEADLOCK MESSAGE'.
FIND PT-PK-SGNOUT-REC DB-KEY IS PT-WK-D431-DBKEY.
The SNAP message is going to the log but the second MODIFY also seems to succumb to an '0829' error (and abort)
- delay the second MODIFY in order to give more time to the competing transaction to complete
- make repeated attempts (for a fixed number of times)
- is the 'COMMIT ALL' insufficient in releasing enought of the resources to allow the competing transaction to complete