Which isolation level should you use?

You are developing an ASP.NET MVC application that reads and writes data from a SQL
Server database. You need to prevent the application from reading data that is locked by
other transactions. You also need to prevent exclusive range locks. Which isolation level
should you use?

You are developing an ASP.NET MVC application that reads and writes data from a SQL
Server database. You need to prevent the application from reading data that is locked by
other transactions. You also need to prevent exclusive range locks. Which isolation level
should you use?

A.
ReadCommitted

B.
Serializable

C.
Repeatable

D.
ReadUncommitted



Leave a Reply 12

Your email address will not be published. Required fields are marked *


Freedrinks

Freedrinks

Why is ReadUncommitted the right answer?

Angelo

Angelo

I think it should be readcomitted

READ UNCOMMITTED
Specifies that statements can read rows that have been modified by other transactions but not yet committed.

READ COMMITTED
Specifies that statements cannot read data that has been modified but not committed by other transactions. This prevents dirty reads. Data can be changed by other transactions between individual statements within the current transaction, resulting in nonrepeatable reads or phantom data. This option is the SQL Server default.

refer to this URL:
https://msdn.microsoft.com/en-us/library/ms173763.aspx

Daniel

Daniel

Requirement: “You need to prevent(!) the application from reading data that is locked by
other transactions.”

but “Readuncommited” does reads all data.

“Readcommited” is prevented(!) from reading locked data, and I therefore think it is the correct answer.

hus

hus

ReadCommitted is the right answer in similar questions.

Psehgaft

Psehgaft

The correct Answer is ReadCommitted

READCOMMITTED
Specifies that statements cannot read data that has been modified but not committed by other transactions. This prevents dirty reads. Data can be changed by other transactions between individual statements within the current transaction, resulting in nonrepeatable reads or phantom data. This option is the SQL Server default.

Test

Test

A is correct

Dasharath

Dasharath

ReadCommitted id correct answer

obbledobble

obbledobble

A – ReadCommitted

Vinc

Vinc

Agree, A is correct.

bob

bob

Why is Repeatable not also correct. It also doesn’t allow reading records which are exclusively locked by other transactions and also doesn’t issue exclusive range locks.

t

t

@bob, “repeatable” is not a valid transaction isolation name, “repetable read” is