TransactionAttribute クラス
アセンブリ: System.EnterpriseServices (system.enterpriseservices.dll 内)

<ComVisibleAttribute(False)> _ <AttributeUsageAttribute(AttributeTargets.Class, Inherited:=True)> _ Public NotInheritable Class TransactionAttribute Inherits Attribute
[ComVisibleAttribute(false)] [AttributeUsageAttribute(AttributeTargets.Class, Inherited=true)] public sealed class TransactionAttribute : Attribute
[ComVisibleAttribute(false)] [AttributeUsageAttribute(AttributeTargets::Class, Inherited=true)] public ref class TransactionAttribute sealed : public Attribute

トランザクション タイプがこの属性で指定されている場合は、COM+ カタログでトランザクション タイプを変更できません。COM+ カタログでトランザクション タイプが変更された場合、コンポーネントでこの属性を使用して同じトランザクション タイプを指定する必要があります。

TransactionAttribute を使用して ServicedComponent をトランザクションとしてマークする方法のコード例を次に示します。
<Transaction()> _ Public Class TransactionalComponent Inherits ServicedComponent Public Sub TransactionalMethod(ByVal data As String) ContextUtil.DeactivateOnReturn = True ContextUtil.MyTransactionVote = TransactionVote.Abort ' Do work with data. Return if any errors occur. ' Vote to commit. If any errors occur, this code will not execute. ContextUtil.MyTransactionVote = TransactionVote.Commit End Sub 'TransactionalMethod End Class 'TransactionalComponent
[Transaction] public class TransactionalComponent : ServicedComponent { public void TransactionalMethod (string data) { ContextUtil.DeactivateOnReturn = true; ContextUtil.MyTransactionVote = TransactionVote.Abort; // Do work with data. Return if any errors occur. // Vote to commit. If any errors occur, this code will not execute. ContextUtil.MyTransactionVote = TransactionVote.Commit; } }
[assembly:System::Reflection::AssemblyKeyFile("Transaction.snk")]; [Transaction] public ref class TransactionalComponent: public ServicedComponent { public: void TransactionalMethod( String^ data ) { ContextUtil::DeactivateOnReturn = true; ContextUtil::MyTransactionVote = TransactionVote::Abort; // do work with data ContextUtil::MyTransactionVote = TransactionVote::Commit; } };
/** @attribute Transaction() */ public class TransactionalComponent extends ServicedComponent { public void TransactionalMethod(String data) { ContextUtil.set_DeactivateOnReturn(true); ContextUtil.set_MyTransactionVote(TransactionVote.Abort); // Do work with data. Return if any errors occur. // Vote to commit. If any errors occur, this code will not execute. ContextUtil.set_MyTransactionVote(TransactionVote.Commit); } //TransactionalMethod } //TransactionalComponent

System.Attribute
System.EnterpriseServices.TransactionAttribute


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TransactionAttribute コンストラクタ ()
アセンブリ: System.EnterpriseServices (system.enterpriseservices.dll 内)


新しい TransactionAttribute を作成するコード例を次に示します。
<Transaction()> _ Public Class TransactionAttribute_Ctor Inherits ServicedComponent End Class 'TransactionAttribute_Ctor
[Transaction] public class TransactionAttribute_Ctor : ServicedComponent { }


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TransactionAttribute コンストラクタ

名前 | 説明 |
---|---|
TransactionAttribute () | TransactionAttribute クラスの新しいインスタンスを初期化して、要求されたコンポーネントのトランザクション タイプを Required に設定します。 |
TransactionAttribute (TransactionOption) | TransactionAttribute クラスの新しいインスタンスを初期化して、トランザクション タイプを指定します。 |

TransactionAttribute コンストラクタ (TransactionOption)
アセンブリ: System.EnterpriseServices (system.enterpriseservices.dll 内)


新しい TransactionAttribute を作成するコード例を次に示します。
<Transaction(TransactionOption.Supported)> _ Public Class TransactionAttribute_Ctor_TransactionOption Inherits ServicedComponent End Class 'TransactionAttribute_Ctor_TransactionOption <Transaction(TransactionOption.Supported, Isolation := TransactionIsolationLevel.Serializable)> _ Public Class TransactionAttribute_Ctor_TransactionOption_Isolation Inherits ServicedComponent End Class 'TransactionAttribute_Ctor_TransactionOption_Isolation <Transaction(TransactionOption.Supported, Isolation := TransactionIsolationLevel.Serializable, Timeout := 30)> _ Public Class TransactionAttribute_Ctor_TransactionOption_Isolation_Timeout Inherits ServicedComponent End Class 'TransactionAttribute_Ctor_TransactionOption_Isolation_Timeout
[Transaction(TransactionOption.Supported)] public class TransactionAttribute_Ctor_TransactionOption : ServicedComponent { } [Transaction(TransactionOption.Supported, Isolation=TransactionIsolationLevel.Serializable)] public class TransactionAttribute_Ctor_TransactionOption_Isolation : ServicedComponent { } [Transaction(TransactionOption.Supported, Isolation=TransactionIsolationLevel.Serializable, Timeout=30)] public class TransactionAttribute_Ctor_TransactionOption_Isolation_Timeout : ServicedComponent { }
/** @attribute Transaction(TransactionOption.Supported) */ public class TransactionAttribute_Ctor_TransactionOption extends ServicedComponent { } //TransactionAttribute_Ctor_TransactionOption /** @attribute Transaction(TransactionOption.Supported, Isolation = TransactionIsolationLevel.Serializable) */ public class TransactionAttribute_Ctor_TransactionOption_Isolation extends ServicedComponent { } //TransactionAttribute_Ctor_TransactionOption_Isolation /** @attribute Transaction(TransactionOption.Supported, Isolation = TransactionIsolationLevel.Serializable, Timeout = 30) */ public class TransactionAttribute_Ctor_TransactionOption_Isolation_Timeout extends ServicedComponent { } //TransactionAttribute_Ctor_TransactionOption_Isolation_Timeout


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TransactionAttribute プロパティ

名前 | 説明 | |
---|---|---|
![]() | Isolation | トランザクション分離レベルを取得または設定します。 |
![]() | Timeout | このトランザクションのタイムアウトを取得または設定します。 |
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。 ( Attribute から継承されます。) |
![]() | Value | トランザクションの TransactionOption 値を取得して、オプションでトランザクション サービスを無効にします。 |

TransactionAttribute メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 ( Attribute から継承されます。) |
![]() | GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 ( Attribute から継承されます。) |
![]() | GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 ( Attribute から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 ( Attribute から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | IsDefaultAttribute | 派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 ( Attribute から継承されます。) |
![]() | IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 ( Attribute から継承されます。) |
![]() | Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 ( Attribute から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

TransactionAttribute メンバ
属性付きオブジェクトで使用できるトランザクションのタイプを指定します。使用できる値は TransactionOption 列挙体のメンバです。
TransactionAttribute データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Isolation | トランザクション分離レベルを取得または設定します。 |
![]() | Timeout | このトランザクションのタイムアウトを取得または設定します。 |
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。(Attribute から継承されます。) |
![]() | Value | トランザクションの TransactionOption 値を取得して、オプションでトランザクション サービスを無効にします。 |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 ( Attribute から継承されます。) |
![]() | GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 (Attribute から継承されます。) |
![]() | GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 (Attribute から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 (Attribute から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | IsDefaultAttribute | 派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 (Attribute から継承されます。) |
![]() | IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 (Attribute から継承されます。) |
![]() | Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (Attribute から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

- TransactionAttributeのページへのリンク