Implementing Interfaces

A resource manager needs to implement only two interfaces in order to work with MS DTC:

IResourceManagerSink

ITransactionResourceAsync

The IResourceManagerSink interface is required to build a relationship between the resource manager and the transaction coordinator. The ITransactionResourceAsync interface is required to receive the two-phase notifications for a transaction on which the resource manager is enlisted. There is one instance of ITransactionResourceAsync per enlistment. Typically, there is one enlistment per transaction, however, a resource manager can choose to enlist multiple times on the same transaction.

A resource manager generally follows these steps:

  1. Builds a relationship with MS DTC
  2. Performs recovery
  3. Enlists in new transactions