Updating a Database and a File from a Single Application

MS DTC is useful when an application must update different types of transaction-protected resources. Consider an order entry application that registers an order in an Order Item database and records a freight bill in a Freight Bill image file. The application developer can use MS DTC to ensure that the database and image file remain consistent by:

  1. Starting an MS DTC transaction.
  2. Enlisting the Order Item database on the transaction.
  3. Enlisting the Freight Bill image file on the transaction.
  4. Updating the order item databases by invoking the appropriate SQL statements or database-stored procedures.
  5. Inserting the freight bill image in the image file.
  6. Committing the MS DTC transaction.

Updating a Database and a File from a Single Application

When the transaction commits, MS DTC ensures that the updates to both the database and the image file are committed. In the event of a client application failure, a network connection failure, an Order Item database server failure, a Freight Bill image file server failure, or any combination of these failures, MS DTC aborts the transaction and instructs the resource managers to undo the effects of the transaction from both the database and the image file.