TransactionOption 列挙型
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
コンポーネントに必要な自動トランザクションのタイプを指定します。
public enum class TransactionOption
[System.Serializable]
public enum TransactionOption
[<System.Serializable>]
type TransactionOption =
Public Enum TransactionOption
- 継承
- 属性
フィールド
Disabled | 0 | 現在のコンテキストのすべてのトランザクションを無視します。 |
NotSupported | 1 | 制御するトランザクションがないコンテキストでコンポーネントを作成します。 |
Required | 3 | トランザクションが存在する場合はこれを共有し、必要に応じて新しいトランザクションを作成します。 |
RequiresNew | 4 | 現在のコンテキストの状態とは関係なく、新しいトランザクションでコンポーネントを作成します。 |
Supported | 2 | トランザクションが存在する場合はこれを共有します。 |
例
次のコード例では、 型の使用方法を TransactionOption 示します。
#using <System.EnterpriseServices.dll>
using namespace System;
using namespace System::EnterpriseServices;
using namespace 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 ref class TransactionDisabled : public ServicedComponent
{
};
// 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 ref class TransactionNotSupported : public ServicedComponent
{
};
// An instance of this class will participate in its caller's transaction
// if one exists.
[Transaction(TransactionOption::Supported)]
public ref class TransactionSupported : public ServicedComponent
{
};
// 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 ref class TransactionRequired : public ServicedComponent
{
};
// A new transaction will always be created for an instance of this class.
[Transaction(TransactionOption::RequiresNew)]
public ref class TransactionRequiresNew : public ServicedComponent
{
};
using System;
using System.EnterpriseServices;
using 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 : ServicedComponent
{
}
// 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 : ServicedComponent
{
}
// An instance of this class will participate in its caller's transaction
// if one exists.
[Transaction(TransactionOption.Supported)]
public class TransactionAttribute_TransactionSupported : ServicedComponent
{
}
// 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 : ServicedComponent
{
}
// A new transaction will always be created for an instance of this class.
[Transaction(TransactionOption.RequiresNew)]
public class TransactionAttribute_TransactionRequiresNew : ServicedComponent
{
}
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
' 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
' 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
' 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
' A new transaction will always be created for an instance of this class.
<Transaction(TransactionOption.RequiresNew)> _
Public Class TransactionAttribute_TransactionRequiresNew
Inherits ServicedComponent
End Class
注釈
.NET インストール ツール (Regsvcs.exe) を使用する場合、 のトランザクション オプションは ServicedComponent 既定で になります Disabled。
適用対象
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET