- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to implement isolation levels CS, RR, UR and RS in a DB2 program?
The isolation level defines the degree to which the DB2 data which is being accessed in the COBOL-DB2 program is isolated with another parallelly executing COBOL- DB2 program. There are 4 main types of Isolation levels in DB2.
Cursor stability (CS) - The cursor stability isolation level locks only the current row which the program is accessing. As soon as the program shifts to the next row, the lock in the previous row gets released. The cursor stability fetches only committed rows for the program to access. This is a default isolation level.
Read stability (RS) - This isolation level places a lock on all the rows which qualifies the SQL statement’s predicate (eg: WHERE clause). The lock is retained until the entire processing is completed.
Uncommitted read (UR) - The uncommitted read isolation level is used in the SQL statements meant for read-only purpose. There is no lock placed on a row/record and it fetches the committed as well as uncommitted rows (from the other programs/transactions).
Repeatable read (RR) - This isolation level is used when we need to retain the locks until a commit.
To define an isolation level for a COBOL-DB2 program, we need to use the corresponding parameter in the ISOLATION option of the BIND step. Below is the JCL step using which isolation level can be defined.
//BIND EXEC PGM=IKJEFT01 //STEPLIB DD DSN=DIS.TEST.LOADLIB,DISP=SHR //SYSOUT DD SYSOUT=* //SYSTSIN DD * DSN SYSTEM(TB3) BIND PLAN(PLANA) - PKLIST(PACKA) - ACQUIRE(ALLOCATE) - ISOLATION (RS) /*
In the above step, we have used the ISOLATION option with RS parameter, which corresponds to read stability. Similarly, we have parameter CS for cursor stability, RR for repeatable read and UR for uncommitted read.
- What are different transaction isolation levels in DBMS?
- What are the transaction isolation levels supported by JDBC API?
- How to precompile a COBOL-DB2 program?
- How to store a NULL value in a particular column of a DB2 table using COBOL-DB2 program?
- A trader recorded below transactions: a) Started business with cash Rs. 30000 b) Purchased securities (in cash) in Rs. 9000 c) Purchased shop for Rs. 30000 (10000 in cash, remaining from loan) d) Sold securities for Rs. 1300 (purchased cost = Rs. 900) e) Purchased a vehicle (cash) for Rs. 2500 f) Salary received (in cash) Rs. 5000 g) Paid Rs.800 for loan and Rs. 400 for interest h) Expenses (in cash) paid Rs. 400 i) Received dividends (in cash) for dividends Rs. 300 Prepare a table using accounting equation
- CSS isolation Property
- How can you revert all the DB2 table changes done in a COBOL-DB2 program?
- Island of Isolation in Java
- How to bind multiple versions of a DB2 program into a package?
- What is Browser Isolation? (Definition, Types, and Usage)
- How to execute a COBOL-DB2 program PROGA of plan PLANA?
- Purpose and usage of SAVEPOINT in COBOL-DB2 program
- Python Program to Implement a Stack
- How LOST UPDATE and DIRTY READ impact the processing of a COBOL-DB2 program?
- How to delete a DB2 table TAB1?