1.

How do you avoid deadlocks while reading data in Mainframe?

Answer»

We can do the FOLLOWING STEPS in order to avoid deadlocks:

  • Use FOR UPDATE clause which ENSURES that U lock is set when a process tries READING data during select operation. This clause does not allow row-blocking.
  • Use the following clauses in queries that ensure U lock is set when a process tries to read the data and allows row-blocking:
    • WITH RR or WITH RS
    • USE AND KEEP UPDATE LOCKS


Discussion

No Comment Found