OperationBehaviorAttribute::TransactionAutoComplete Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets a value that indicates whether to automatically complete the current transaction scope if no unhandled exceptions occur.

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

public:
property bool TransactionAutoComplete {
	bool get();
	void set(bool value);
}

Property Value

Type: System::Boolean

true to complete the transaction scope automatically on successful execution of the operation; otherwise, false. The default is true.

Set the TransactionAutoComplete property to false to complete or abort transactions directly in the code for the operation.

Handled exceptions can be thrown in the course of the operation without automatically aborting the transaction. Only unhandled exceptions trigger an automatic abort.

The following code example shows an operation that executes within a mandatory distributed transaction. The TransactionScopeRequired property indicates that the operation executes under a transaction scope and the TransactionAutoComplete property indicates that if no unhandled exceptions occur, the transaction scope is completed automatically. If an unhandled exception does occur, the transaction is aborted.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top
Show: