The DP4 change verify facility prevents a record from being updated twice if it is in contention . If an update fails because a record has been updated by another user and your program does not provide a way to recover from the situation, the program will halt and any pending transactions will be lost.
You can use the change verify facility to handle an update failure in two ways:
If you choose to provide a recovery routine, you should test the variable fail_code which is returned after an attempted update. Use the value of the return code to determine whether the recovery routine is executed:
| 0 | Update successful |
| 3 | Contention failure on one of the records |
| 4 | Orphan check failure |
| 5 | One of the records updated was locked by another user |
The fail code is returned at the end of a procedure body which secures changes. In applications which use the private database, the code is returned only when records are updated to the public database.
You may display a fail message following an unsuccessful attempt to update the database, depending on your answer to the Suppress update fail messages question.
In the Program Summary answer yes to the question Stop program if update fails ?