From the course: Migrating COBOL Apps
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
The deadly embrace - COBOL Tutorial
From the course: Migrating COBOL Apps
The deadly embrace
- [Instructor] The solution to buried updates is to lock a file before processing it, which COBOL can do with its lock clauses. However, this introduces a second issue known as the deadly embrace which can occur at a file level or a record level. Let's see how this happens. Here we have two programs which can both access the same two files. Program 1 accesses file 1 in order to write to it and establishes its lock on that file. Program 2 accesses file 2 in order to write to it and establishes its lock on that file. It then attempts to access file 1 to write to it, but can't do that as it's locked. So it waits for the lock to be released. Meanwhile, program 1 now attempts to write to file 2, which it also can't do as it's locked and so it waits. However, it doesn't plan on releasing the file lock on file 1 until it's completed writing to file 2. Similarly program 2 doesn't plan on releasing the file lock on file 2 until…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Self-modifying code2m 1s
-
(Locked)
Dynamic calls to subprograms2m 20s
-
(Locked)
Understand XA transactions2m 27s
-
(Locked)
The buried update3m 52s
-
(Locked)
The deadly embrace1m 28s
-
(Locked)
Legacy control flow2m 52s
-
(Locked)
Challenge: Trace the control flow28s
-
(Locked)
Solution: Trace the control flow6m 38s
-
-
-
-
-