PrepAway - Latest Free Exam Questions & Answers

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.)

PrepAway - Latest Free Exam Questions & Answers

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.

4 Comments on “Which isolation level should you identify?

  1. Dim says:

    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.




    0



    0
      1. Skippo says:

        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.




        0



        0

Leave a Reply