You are an enterprise application developer. You are creating a component that will be used in an order fulfillment process.
The component performs the following two tasks:
* Modifies data in a local Microsoft SQL Server database
* Adds data to a remote SQL Server database
The application that uses the component is multithreaded. Each application thread that uses the component creates its own instances of the component classes. You need to ensure that the component either performs both tasks successfully or performs neither task. What should you do?
A.
Use the System.Threading.Monitor class to synchronize the code segment that performs the data modifications and submits the message.
B.
Use classes in the System.Transactions namespace to enlist both tasks in a distributed transaction.
C.
Enable Multiple Active Result Sets (MARS) for each database connection.
D.
Use ADO.NET DataAdapter objects that are configured to support batch updates.