IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DB2 isolation Levels - CS and RR


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anup_marathe

New User


Joined: 17 Jan 2006
Posts: 2
Location: India

PostPosted: Tue Jan 17, 2006 2:53 pm
Reply with quote

Can somebody specify the exact difference between Isolation levels CS and RR.
consider a scenario where I am updating table through a cursor with Isolation level CS. I have updated the 5th row in cursor and now I am on 6th row. commit is not issued yet.
then, at this time, can any other application read or update the 5th row?
Back to top
View user's profile Send private message
nrsmca

New User


Joined: 25 May 2005
Posts: 14

PostPosted: Tue Jan 17, 2006 4:18 pm
Reply with quote

Hi,

The another program can Update or read the 5 th row...because the lock is released from 5th row...!

Bye,
nrsmca
Back to top
View user's profile Send private message
senthilssg

New User


Joined: 09 Dec 2005
Posts: 64
Location: USA

PostPosted: Tue Jan 17, 2006 5:04 pm
Reply with quote

Hi anup_marathe,

i agree with nrsmca 's point .

please refer this , i think , you will get idea about cursor stability isolation .

When the Cursor Stability isolation level is used, each row that is referenced by a cursor being used by the isolating transaction is locked as long as the cursor is positioned on that row. The lock acquired remains in effect either until the cursor is repositioned (usually by calling the FETCH statement) or until the isolating transaction terminates. Thus, when this isolation level is used, SELECT statements that are issued more than once within the same transaction may not always yield the same results. Lost updates and dirty reads cannot occur; non repeatable reads and phantoms, however, can and may be seen.

When a transaction using the Cursor Stability isolation level retrieves a row from a table via an updatable cursor, no other transaction can update or delete that row while the cursor is positioned on it. However, other transactions can add new rows to the table and perform update and/or delete operations on rows positioned on either side of the locked row, provided that the locked row itself was not accessed using an index. Furthermore, if the isolating transaction modifies any row it retrieves, no other transaction can update or delete that row until the isolating transaction is terminated, even after the cursor is no longer positioned on the modified row.




Regards ,
Senthil

'CORRECT ME IF I'M WRONG'
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Easytrieve provides how many levels o... Mainframe Interview Questions 11
No new posts Current Isolation level DB2 2
No new posts Problem related to isolation level. DB2 1
No new posts Lock termination with RR isolation Level DB2 1
No new posts Mutiple 01 levels in copybook COBOL Programming 3
Search our Forums:

Back to Top