Ansicht
Dokumentation

MODIFY in RSQL not allowed to produce DUPLICATEKEY <br />Tip-No.: 2203 ( INFO2203 )

MODIFY in RSQL not allowed to produce DUPLICATEKEY
Tip-No.: 2203 ( INFO2203 )

BAL_S_LOG - Application Log: Log header data   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

Short text

MODIFY in RSQL not allowed to produce DUPLICATEKEY
Tip-No.: 2203

Symptom

The RSQL/RTAB function MODIFY returns the error DUPLICATEKEY.
This can can occur, for example, when using the MODIFY statement
in ABAP.

Cause

Can be caused by ORACLE's locking behavior (and in other DBs with
Rowlevellocking): as long as the INSERT of a record is not confirmed
(COMMIT), other processs cannot see it - i.e. SELECTs, DELETEs and
UPDATES cannot find it (NOT FOUND). However, an INSERT attempt with the
same key (UNIQUE index required) of another process will be blocked,
until the first process decides to COMMIT or ROLLBACK. COMMIT gives
the other process its DUPLICATEKEY, ROLLBACK allows it to proceed.
The RSQL/RTAB-MODIFY is programmed as follws:
( i) Attempt an UPDATE
If OK: finished
If error other than NOTFOUND occurs: error abend
Otherwise:
(ii) VAttempt an NSERT
If OK: finished
Sonst: Fehlerabbruch
The possibility that INSERT of a parallel process might run into a
DUPLICATEKEY was not taken into account. And precisely this was the
problrm here.

Solution

Remedied with Corr. No.s B11K005914, BINK012450.
The previous order: UPDATE, if NOTFOUND INSERT is expanded to
UPDATE, if NOTFOUND INSERT, if DUPLICATEKEY UPDATE
(planned for 11E).






CL_GUI_FRONTEND_SERVICES - Frontend Services   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 1537 Date: 20240426 Time: 141516     sap01-206 ( 14 ms )