Home » Microsoft » 70-487 v.2 » Which code segment should you use?
You need to update the CreateMonthlyTotalsReports() method to use database transactions. Which code segment should you use?
A. SqlConnection.BeginTransaction(lsolationLevel.Chaos);
B. SqlConnection.BeginTransaction(lsolationLevel.Serializable);
C. SqlConnection.BeginTransaction(lsolationLevel.ReadCommitted);
D. SqlConnection.BeginTransaction(lsolationLevel.ReadUncommitted);
Correct Answer: B
Explanation/Reference:
Explanation:
Scenario: The CreateMonthlyTotalsReport() method must lock the data and prevent others from updating or inserting new rows until complete.
The highest isolation level, Serializable, provides a high degree of protection against interruptive transactions, but requires that each transaction complete before any other transactions are allowed to operate on the data.
With Serializable volatile data can be read but not modified, and no new data can be added during the transaction.