PrepAway - Latest Free Exam Questions & Answers

What isolation level should you use?

You are a database developer. You plan to design a database solution by using SQL Server 2008. A stored procedure in a database uses a transaction to retrieve data from a table and produces aggregations. You must design a solution that meets the following requirements:
* Update operations cannot be performed on the retrieved data while the stored procedure is being executed.
* Insert operations in the table can be performed while the stored procedure is being executed.
You need to ensure that the solution meets the requirements. What isolation level should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
SERIALIZABLE

B.
READ COMMITTED

C.
REPEATABLE READ

D.
READ UNCOMMITTED

Explanation:
REPEATABLE READ

Specifies that statements cannot read data that has been modified but not yet committed by other transactions and that no other transactions can modify data that has been read by the current transaction until the current transaction completes.

Shared locks are placed on all data read by each statement in the transaction and are held until the transaction completes. This prevents other transactions from modifying any rows that have been read by the current transaction. Other transactions can insert new rows that match the search conditions of statements issued by the current transaction. If the current transaction then retries the statement it will retrieve the new rows, which results in phantom reads. Because shared locks are held to the end of a transaction instead of being released at the end of each statement, concurrency is lower than the default READ COMMITTED isolation level. Use this option only when necessary.


Leave a Reply