Which isolation level should you identify?

DRAG DROP
You plan to deploy two stored procedures name USP_1 and USP_2 that read data from a
database.
Your company identifies the following requirements for each stored procedure:
USP_1 cannot allow dirty reads.
USP_2 must place range locks on the data to ensure read consistency.
You need to identify which isolation level you must set for each stored procedure. The
solution must minimize the number of locks.
Which isolation level should you identify?
To answer, drag the appropriate isolation level to the correct stored procedure in the answer
area. (Answer choices may be used once, more than once, or not at all.)

DRAG DROP
You plan to deploy two stored procedures name USP_1 and USP_2 that read data from a
database.
Your company identifies the following requirements for each stored procedure:
USP_1 cannot allow dirty reads.
USP_2 must place range locks on the data to ensure read consistency.
You need to identify which isolation level you must set for each stored procedure. The
solution must minimize the number of locks.
Which isolation level should you identify?
To answer, drag the appropriate isolation level to the correct stored procedure in the answer
area. (Answer choices may be used once, more than once, or not at all.)

Answer:

Explanation:

* read committed
READ COMMITTED
Specifies that shared locks are held while the data is being read to avoid dirty reads, but the
data can be changed before the end of the transaction, resulting in nonrepeatable reads or
phantom data. This option is the SQL Server default.

* SERIALIZABLE
Places a range lock on the data set, preventing other users from updating or inserting rows
into the data set until the transaction is complete. This is the most restrictive of the four
isolation levels. Because concurrency is lower, use this option only when necessary. This
option has the same effect as setting HOLDLOCK on all tables in all SELECT statements in
a transaction.



Leave a Reply 4

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


Dim

Dim

What about the “The solution must minimize the number of locks” requirement?
Why not to use “snapshot” for SP2? It provides read consistency and doesnt
locks the data.

yangbration

yangbration

See part of SERIALIZABLE
https://msdn.microsoft.com/en-us/library/ms173763.aspx

Skippo

Skippo

For USP_2, as long as the main requirement is to ensure READ CONSISTENCY, then SNAPSHOT isolation level should suffice.

If the question did not further require minimizing number of locks, then SERIALIZABLE isolation would have been the correct option.

Gerry

Gerry

is confused for sp2 the requeriment