This documentation is archived and is not being maintained.
TransactionOption Enumeration
Visual Studio 2008
Specifies the automatic transaction type requested by the component.
Assembly: System.EnterpriseServices (in System.EnterpriseServices.dll)
| Member name | Description | |
|---|---|---|
| Disabled | Ignores any transaction in the current context. | |
| NotSupported | Creates the component in a context with no governing transaction. | |
| Supported | Shares a transaction, if one exists. | |
| Required | Shares a transaction, if one exists, and creates a new transaction if necessary. | |
| RequiresNew | Creates the component with a new transaction, regardless of the state of the current context. |
When using the .NET Installation Tool (Regsvcs.exe), the transaction option for a ServicedComponent defaults to Disabled.
The following code example demonstrates the use of the TransactionOption type.
Imports System Imports System.EnterpriseServices Imports System.Reflection ' References: ' System.EnterpriseServices ' An instance of this class will not participate in transactions, but can ' share its caller's context even if its caller is configured as ' NotSupported, Supported, Required, or RequiresNew. <Transaction(TransactionOption.Disabled)> _ Public Class TransactionAttribute_TransactionDisabled Inherits ServicedComponent End Class 'TransactionAttribute_TransactionDisabled ' An instance of this class will not participate in transactions, and will ' share its caller's context only if its caller is also configured as ' NotSupported. <Transaction(TransactionOption.NotSupported)> _ Public Class TransactionAttribute_TransactionNotSupported Inherits ServicedComponent End Class 'TransactionAttribute_TransactionNotSupported ' An instance of this class will participate in its caller's transaction ' if one exists. <Transaction(TransactionOption.Supported)> _ Public Class TransactionAttribute_TransactionSupported Inherits ServicedComponent End Class 'TransactionAttribute_TransactionSupported ' An instance of this class will participate in its caller's transaction ' if one exists. If not, a new transaction will be created for it. <Transaction(TransactionOption.Required)> _ Public Class TransactionAttribute_TransactionRequired Inherits ServicedComponent End Class 'TransactionAttribute_TransactionRequired ' A new transaction will always be created for an instance of this class. <Transaction(TransactionOption.RequiresNew)> _ Public Class TransactionAttribute_TransactionRequiresNew Inherits ServicedComponent End Class 'TransactionAttribute_TransactionRequiresNew
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: