Tuesday 13 December 2016

What is Transaction Propagation?

Transaction propagation is the ability to propagate a transaction across the boundaries of a single service. Or in other words, we can say that a service can participate in a transaction that is initiated by a client. 

In a SOA environment, transaction propagation becomes a key requirement. As we know, WCF supports SOA, so it provides support for transaction propagation as well.

To enable transaction propagation, we need to set the value of the TransactionFlow property of the binding being used. This can be done programmatically as follows: 
  1. WSHttpBinding bindingBeingUsed = new WSHttpBinding();  
  2. bindingBeingUsed.TransactionFlow = "true";  
Or it can be done decoratively by updating the configuration file as follows:
  1. <bindings>  
  2.     <wsHttpBinding>  
  3.         <binding name="binding1" transactionFlow="true" />   
  4.     </wsHttpBinding>  
  5. </bindings>  
The default value for the TransactionFlow property is "False".

Do all WCF bindings support Transaction Propagation?

No. Not all WCF bindings support transaction propagation. Only the following list of bindings support it:
  • wsHttpBinding
  • netTcpBinding
  • netNamedPipeBinding
  • wsDualHttpBinding
  • wsFederationHttpBinding

No comments:

Post a Comment