Udostępnij za pośrednictwem


WCF Transaction Flows

When you wish to flow transactions between a client and a WCF Service there are three key tasks to be considered:

 

1) The binding that you select (which is set on be both the client and service side), should be transaction aware. Within the configuration file you should also set the transaction flow attribute to true.

 

2) For each of the services operational contracts, the transaction flow option should also be specified, either 'NotAllowed', 'Allowed' or 'Mandatory'.

 

3) You must specifically mark the service methods that you wish to be transactional. This is set as an 'Operation Behaviour' attribute called 'Transaction Scope Required', and this should be set to true.

 

There is a great article with full details at: https://msdn.microsoft.com/msdnmag/issues/07/05/Foundations/default.aspx

 

Chris Forster