Freigeben über


Attribute Driven Transactions

How are transactions controlled by decorating attributes on service methods?

There are three important transaction-related attributes that can be supplied through operation behaviors on the service implementation.

1.
By setting the TransactionScopeRequired setting to true, all of the code in the service operation implementation runs inside of a TransactionScope. Without a transaction scope, the other attributes described here aren't very interesting.
2.
The TransactionAutoComplete setting controls whether the transaction automatically completes at the end of the service operation. The transaction will only be completed if the operation was successful and didn't throw an exception. An exception causes the transaction to be aborted.
3.
The TransactionFlowOption setting controls whether the transaction scope is a new transaction or is a transaction that comes from the caller. There are three options to distinguish the case where the caller might provide a transaction from the case where the caller must provide a transaction.

Next time: Number of Connections for Secure Conversation

Comments

  • Anonymous
    August 29, 2007
    Here's a quick guide to how an address that uses the net.msmq scheme in WCF gets turned into an actual