MCAD - Microsoft Certified Application Developer Question & Answers
You develop an enterprise application, called XYZApplication that includes a Windows Form presentation layer, middle-tier components for business logic and data access, and a Microsoft SQL Server database.
You are in the process of creating a middle-tier component that will execute the data access routines in your application. When data is passed to this component, the component will call several SQL Server stored procedures to perform database updates. All of these procedure calls run under the control of a single transaction.
The code for the middle-tier component will implement the following objects:
SqlConnection cn = new SqlConnection();
If two users try to update the same data concurrently, inconsistencies such as phantom reads will occur. You must now add code to your component to specify the highest possible level of protection against such inconsistencies.
Which code segment should you use?
|A) tr = cn.BeginTransaction(?ReadCommitted?);||B) tr = cn.BeginTransaction(IsolationLevel.ReadCommitted);|
|C) tr = cn.BeginTransaction(IsolationLevel.Serializable);||D) tr = cn.BeginTransaction(?Serializable?);|
Serializable is the highest isolation transaction level. It provide the highest possible level of protection against concurrent data errors. The correct syntax to begin a transaction with this transaction isolation level is: cn.BeginTransaction(IsolationLevel.Serializable)
Tags: You develop an enterprise application called XYZApplication that includes a Windows Form presentation layer middle-tier components for business logic and data access and a Microsoft SQL Server data
- Related Questions