Blue Theme Orange Theme Green Theme Red Theme
 
Team Foundation Server Hosting
Home | Forums | ASP.NET 2.0 Tutorials | Web Services | How Do I...? | Class Browser | WPF Quick Starts | Advertise with Us
 | Consulting  
Submit an Article Submit a Blog 
Search :       Advanced Search »
Home » Blogs Home » Blog Detail

Transaction Isolation - Part 5 [Read UnCommitted]

 by Sivaraman Dhamodaran on Feb 01, 2012

We will have a look at what is Read Uncommitted Transaction and what is Dirty reads
Comments: 0 Views: 574 Printable Version 

The Read Uncommitted transaction Isolation level does not prevent read as well as the Write operation. This means that when a row is half updated and still in progress and read operation (Select statement) can still proceed there. We call this as Dirty Read or Uncommitted data. Look at the T-SQL statements below:

 

Query Window 1:

 

Set transaction Isolation level Read UnCommitted;

Begin Transaction

Update student set class = 7 where studid = 103;

commit;

 

Query Window 2:

 

Set transaction Isolation level Read UnCommitted;

Begin Transaction;

      Select * from student;

commit;

 

In both the SQL transaction above (One Select and One Update) we wet the transaction isolation level to UnCommitted using the Set transaction. This means we are requesting that we want to read data without any delays and we don't care about the dirty data. Now execute the statement till update in the query window 1, delaying the execution of commit (Do not execute that now). Now execute the all the statements in the Query window 2. What happens? No delay on retrieving the set of records right? And see, you got Hansika as 7th STD girl. Even though the update in the query window 1 is not committed we are still seeing the updated result in the query window2. Now execute the commit statement in Query Window 1. We kept the Isolation level to uncommitted again before making the selection. Why because, the Read operation in Query window 2 otherwise defaults to Read Committed. 
Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
 
What do you say about this post? Post a comment here
*Title:
*Comment:
 
Comments not available.
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor

 Blogger's Profile
Age: Not Available
Location:
Title: Systems Engineer
Joined: Oct 21, 2010
Education: Masters Degree
 More Blogs from this Blogger
[Video] OnClose Handler
[Video] Storing and Loading the Window and Toolbar position
Swapping Exe Process
How Exe file is Generated by VS2005 C++ Project?
What is Exe
Header files: Multiple Inclusion problem - Solution B
Header files: Multiple Inclusion problem - Solution A
Header files: Multiple Inclusion problem - Reason
Header files: Multiple Inclusion problem
Header file inclusion techniques
View all »
 Latest Blogs
[Video] OnClose Handler
[Video] Storing and Loading the Window and Toolbar position
The Euclidean Algorithm
Swapping Exe Process
How Exe file is Generated by VS2005 C++ Project?
What is Exe
Header files: Multiple Inclusion problem - Solution B
Header files: Multiple Inclusion problem - Solution A
Header files: Multiple Inclusion problem - Reason
Header files: Multiple Inclusion problem
View all »
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 

 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.