Designing a WCF Service to Support Transactions

The previous sections have shown you how to implement transactions in a WCF service, but there are a number of issues you should be aware of when designing a WCF service that requires transactions.

Transactions and Service Instance Context Modes

If you set the TransactionAutoComplete property of the OperationBehavior attribute of one or more methods in a WCF service to false, you must use the PerSession service instance context mode. This is because the WCF runtime needs to maintain transactional state between calls to operations. If you set the TransactionAutoComplete property to true for every operation, the WCF runtime does not need to maintain transactional state as it completes the current transaction ...

Get Microsoft® Windows® Communication Foundation Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.