Sunday, April 08, 2007

Review topic: CICS, conflicts when updating files; a caution

CICS, in updating VSAM files, can encounter deadlocks or logical contradictions. This sort of problem can really happen with any database management system on any kind of platform, mainframe or client-server.

One situation might occur when a user executes a CICS READ with an UPDATE option, while another user changes or deletes the record. In pseudo-conversational programming, the program would need to save a copy of the record in (a copy of) the communications area in working storage (or in a temporary storage queue) before the program “ends” after sending it to the end user. When it starts a program when receiving the user’s change, it then does the read with update and compares to the save area copy. If not the same, it cancels the rewrite and issues an error.

A deadly embrace or deadlock can occur when two different tasks with different users update the same records in different files and in different orders. The fix is usually to make the order of access and update the same for all programs, all transactions. This was a huge problem (Rollbacks) on a Univac system with DMS-1100 at a big benchmark back in 1974 and took a week to find. This kind of problem can occur in any dbms.

The TOKEN option used to tell CICS when a record is read that it will be held for update.

The MASSINSERT option effectively creates a lock on a record (as well as splitting a VSAM control interval at the point of insertion).

Although these postings should help job candidates prepare for technical quizzes before interviews, the focus is not on any particular quiz. The review topics are generally items that would be needed on the job for a contractor candidate who is to be “job ready” when he or she shows up for an assignment.

No comments: