70-465 · Question #40
You need to recommend an isolation level for usp_UpdateOrderDetails. Which isolation level should you recommend?
The correct answer is B. Repeatable read. For a stored procedure that updates order details, Repeatable Read ensures that data read during the transaction cannot be modified by other transactions until the current transaction completes, preventing non-repeatable reads while maintaining concurrency.
Question
Options
- ARead committed
- BRepeatable read
- CRead uncommitted
- DSerializable
How the community answered
(29 responses)- A3% (1)
- B76% (22)
- C14% (4)
- D7% (2)
Why each option
For a stored procedure that updates order details, Repeatable Read ensures that data read during the transaction cannot be modified by other transactions until the current transaction completes, preventing non-repeatable reads while maintaining concurrency.
Read Committed only prevents dirty reads but allows non-repeatable reads, meaning another transaction could modify order data between the initial read and the update within usp_UpdateOrderDetails, leading to data inconsistency.
Repeatable Read isolation level guarantees that any data read by a transaction will remain unchanged for the duration of that transaction, preventing dirty reads and non-repeatable reads. For usp_UpdateOrderDetails, this is critical because the procedure likely reads order data before updating it, and Repeatable Read ensures no other transaction can modify those rows between the read and the update, maintaining data consistency without the full overhead of Serializable.
Read Uncommitted is the lowest isolation level and allows dirty reads, meaning the procedure could read uncommitted, potentially rolled-back data from other transactions, which is unacceptable for an update operation on order details.
Serializable is the most restrictive isolation level and prevents phantom reads by locking entire ranges, but it introduces significant blocking and reduces concurrency beyond what is necessary for updating existing order detail rows.
Concept tested: SQL Server transaction isolation levels for update procedures
Source: https://learn.microsoft.com/en-us/sql/t-sql/statements/set-transaction-isolation-level-transact-sql
Topics
Community Discussion
No community discussion yet for this question.