How LOST UPDATE and DIRTY READ impact the processing of a COBOL-DB2 program?


The LOST UPDATE and DIRTY read issues are related to concurrency. The concurrency is defined as the ability of two or more applications to access the same table data.

The LOST UPDATE impacts the processing of COBOL-DB2 programs in the following way.

Suppose there are 2 application programs — PROG A and PROG B which are trying to access the same row of ORDERS DB2 table. PROG A and PROG B read a row from the ORDERS table with ORDER_ID = ‘Z87661’ at the same time. PROG A updates some data in this row and commits the changes. PROG B now updates the same row and commits the changes but the changes done by PROG A will be overlaid.

The DIRTY READ impacts the processing of COBOL-DB2 programs in the following way - Suppose there are 2 application programs - PROG A and PROG B - PROG A inserts a new row in ORDERS DB2 table. PROG B reads that newly inserted row from the ORDERS table. PROG A now ROLLBACK the insertion of the new row. PROG B is now having a row which does not exist in the ORDERS table.

Updated on: 30-Nov-2020

497 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements