CommittableTransaction クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
コミットできるトランザクションを示します。
public ref class CommittableTransaction sealed : System::Transactions::Transaction, IAsyncResult
public ref class CommittableTransaction sealed : System::Transactions::Transaction, IAsyncResult, IDisposable, System::Runtime::Serialization::ISerializable
public sealed class CommittableTransaction : System.Transactions.Transaction, IAsyncResult
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public sealed class CommittableTransaction : System.Transactions.Transaction, IAsyncResult
[System.Serializable]
public sealed class CommittableTransaction : System.Transactions.Transaction, IAsyncResult
[System.Serializable]
public sealed class CommittableTransaction : System.Transactions.Transaction, IAsyncResult, IDisposable, System.Runtime.Serialization.ISerializable
type CommittableTransaction = class
inherit Transaction
interface IAsyncResult
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
type CommittableTransaction = class
inherit Transaction
interface IAsyncResult
[<System.Serializable>]
type CommittableTransaction = class
inherit Transaction
interface IAsyncResult
[<System.Serializable>]
type CommittableTransaction = class
inherit Transaction
interface ISerializable
interface IDisposable
interface IAsyncResult
Public NotInheritable Class CommittableTransaction
Inherits Transaction
Implements IAsyncResult
Public NotInheritable Class CommittableTransaction
Inherits Transaction
Implements IAsyncResult, IDisposable, ISerializable
- 継承
- 属性
- 実装
注釈
CommittableTransaction
クラスは、TransactionScope クラスが暗黙的に使用されるのと対照的に、アプリケーションがトランザクションを明示的に使用する方法を提供します。 TransactionScope クラスとは異なり、アプリケーション作成者はトランザクションをコミットまたは中止するために、具体的に Commit メソッドまたは Rollback メソッドを呼び出す必要があります。 ただし、トランザクションの作成者のみがトランザクションをコミットできます。 したがって、メソッドを介して取得されたコミット可能なトランザクションの Transaction.Clone コピーはコミット可能ではありません。
注意
アンビエント トランザクション コンテキストが自動的に管理されるように、クラスを使用して TransactionScope 暗黙的なトランザクションを作成することをお勧めします。 また、複数の TransactionScope 関数呼び出しまたは複数のスレッド呼び出しで同じトランザクションを使用する必要があるアプリケーションには、クラスと DependentTransaction クラスも使用する必要があります。 このモデルの詳細については、「 トランザクション スコープを使用した暗黙的なトランザクションの実装 」トピックを参照してください。
A を CommittableTransaction 作成しても、アンビエント トランザクション (コードが実行するトランザクション) は自動的に設定されません。 グローバル Transaction オブジェクトの静的Transaction.Currentプロパティを呼び出すことで、アンビエント トランザクションを取得または設定できます。 アンビエント トランザクションの詳細については、「トランザクション スコープを使用した暗黙的なトランザクションの実装」トピックの「TransactionScopeOption を使用したトランザクション Flowの管理」セクションを参照してください。 アンビエント トランザクションが設定されていない場合、リソース マネージャーに対する操作は、そのトランザクションの一部ではありません。 リソース マネージャーが適切なトランザクション コンテキストで動作するように、アンビエント トランザクションを明示的に設定およびリセットする必要があります。
コミット CommittableTransaction されるまで、トランザクションに関連するすべてのリソースはロックされたままです。
CommittableTransaction オブジェクトは再利用できません。 コミットまたはロールバックされた後は、トランザクションで再び使用したり、現在のアンビエント トランザクション コンテキストとして設定したりすることはできません。
コンストラクター
CommittableTransaction() |
CommittableTransaction クラスの新しいインスタンスを初期化します。 |
CommittableTransaction(TimeSpan) |
指定した |
CommittableTransaction(TransactionOptions) |
指定したトランザクション オプションを使用して、CommittableTransaction クラスの新しいインスタンスを初期化します。 |
プロパティ
IsolationLevel |
トランザクションの分離レベルを取得します。 (継承元 Transaction) |
PromoterType |
トランザクションを昇格するときに、Promote メソッドで返される |
TransactionInformation |
トランザクションの追加情報を取得します。 (継承元 Transaction) |
メソッド
events
TransactionCompleted |
トランザクションが完了したことを示します。 (継承元 Transaction) |
明示的なインターフェイスの実装
IAsyncResult.AsyncState |
BeginCommit(AsyncCallback, Object) メソッド呼び出しの最後のパラメーターに指定されたオブジェクトを取得します。 |
IAsyncResult.AsyncWaitHandle |
非同期操作が完了するまで待機するために使用する WaitHandle を取得します。 |
IAsyncResult.CompletedSynchronously |
非同期のコミット操作が同期的に完了したかどうかを示す値を取得します。 |
IAsyncResult.IsCompleted |
非同期のコミット操作が完了したかどうかを示す値を取得します。 |
ISerializable.GetObjectData(SerializationInfo, StreamingContext) |
SerializationInfo に、オブジェクトをシリアル化するために必要なデータを設定します。 |
ISerializable.GetObjectData(SerializationInfo, StreamingContext) |
このトランザクションのシリアル化に必要なデータを含む SerializationInfo を取得します。 (継承元 Transaction) |
適用対象
スレッド セーフ
この型はスレッド セーフです。