This documentation is archived and is not being maintained.

TransactionInterop Class

Facilitates interaction between System.Transactions and components that were previously written to interact with MSDTC, COM+, or System.EnterpriseServices. This class cannot be inherited.


Namespace:  System.Transactions
Assembly:  System.Transactions (in System.Transactions.dll)

[<PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")>]
type TransactionInterop =  class end

The TransactionInterop type exposes the following members.

Public methodStatic memberGetDtcTransactionGets an IDtcTransaction instance that represents a Transaction.  
Public methodStatic memberGetExportCookieTransforms a transaction object into an export transaction cookie.
Public methodStatic memberGetTransactionFromDtcTransactionGenerates a Transaction from a specified IDtcTransaction.
Public methodStatic memberGetTransactionFromExportCookieGenerates a Transaction from the specified an export cookie.  
Public methodStatic memberGetTransactionFromTransmitterPropagationTokenGenerates a Transaction instance from the specified transmitter propagation token. 
Public methodStatic memberGetTransmitterPropagationTokenGenerates a propagation token for the specified Transaction.
Public methodStatic memberGetWhereaboutsGets the Whereabouts of the distributed transaction manager that System.Transactions uses.  

This class provides methods for transaction propagation. For more information on how this process works, see Transaction Propagation.

Using the methods provided by this class, you can engage in two types of transaction propagations, Export/Import (push model) and Transmitter/Receiver (pull model).

The Export/Import (push model) propagation involves these steps,

  1. On the remote machine, obtain the "whereabouts" of the transaction manager of that machine by calling the GetWhereabouts method. You can then cache this piece of information on the client machine for future usage.

  2. Send the data containing the whereabouts to the client machine using any preferred method

  3. On the client machine, use the whereabouts to "export" the transaction to the remote machine and generate a transaction "cookie". This is done by calling GetExportCookie and passing in the remote machine's whereabouts.

  4. Send the data containing the transaction "cookie" to the remote machine using any preferred method

  5. On the remote machine, use the transaction "cookie" to obtain a clone of the client transaction by calling the GetTransactionFromExportCookie method.

  6. On the remote machine, use the clone transaction to enlist the resource manager using the EnlistVolatile or EnlistDurable methods of the Transaction class.

The Transmitter/Receiver (pull model) propagation involves these steps,

  • On the client machine, using the transaction generates a corresponding "propagation token" by calling GetTransmitterPropagationToken

  • Send the data containing the "propagation token" of the transaction to the remote machine using any preferred method

  • On the remote machine, use the "propagation token" to obtain a clone of the client transaction by calling GetTransactionFromTransmitterPropagationToken

The Transmitter/Receiver model provides better performance in scenarios where the transaction token is sent to a remote machine, but the remote machine may not use it to obtain the transaction. This is because the transaction is not propagated until GetTransactionFromTransmitterPropagationToken is called. Another advantage is that the propagation token can be sent to any remote machine, while the export cookie can be used only on the machine that provided the whereabouts.

However, you should also note that the whereabouts of remote transaction managers are encapsulated in all the propagation tokens, making them bigger than the corresponding transaction cookies from the Export/Import model.

Note   This type uses LinkDemand to prevent it from being called from untrusted code; however, only the immediate caller is required to possess the FullTrust permission set.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.