Tuesday, March 24, 2015

Isolation Levels - Practice session


Sno
Session 1
Session 2
Iso Level
Output
Isolated?
Comments
1
begin tran
select * from persontmp
waitfor delay '00:00:10'
select * from persontmp
commit
begin tran
update persontmp set age=25 where personname='Shilpa'
commit tran
read committed
got different ages for shilpa
No
Dirty Reads
2
begin tran
select * from persontmp
waitfor delay '00:00:10'
select * from persontmp
commit
begin tran
insert into persontmp values ('Veera','M','AP',36)
commit tran tran
read committed
got different number of rows
No
Photom Rows
3

begin tran
select * from persontmp
waitfor delay '00:00:10'
select * from persontmp
commit
begin tran
update persontmp set age=27 where personname='Shilpa'
commit tran
repeatable read
got same age for both queries for shilpa
Yes
NA
4

begin tran
select * from persontmp
waitfor delay '00:00:10'
select * from persontmp
commit
begin tran
insert into persontmp values ('Veera','M','AP',36)
commit ran
repeatable read
got different number of rows
No
Photom Rows
5

begin tran
select * from persontmp
waitfor delay '00:00:10'
select * from persontmp
commit
begin tran
insert into persontmp values ('Veera','M','AP',36)
commit ran
serializable
got same number of rows
Yes
NA
6

begin tran
select * from persontmp
waitfor delay '00:00:10'
select * from persontmp
commit
begin tran
update persontmp set age=37 where personname='Shilpa'
commit tran
serializable
got same age for both queries for shilpa
Yes
NA

No comments:

Post a Comment