Message.IsFirstInTransaction プロパティとは何? わかりやすく解説 Weblio辞書 (original) (raw)
そのメッセージがトランザクションで送信された最初のメッセージかどうかを示す値を取得します。
名前空間: System.Messaging
アセンブリ: System.Messaging (system.messaging.dll 内)
構文
Public ReadOnly Property IsFirstInTransaction As Boolean
Dim instance As Message Dim value As Boolean
value = instance.IsFirstInTransaction
public bool IsFirstInTransaction { get; }
public: property bool IsFirstInTransaction { bool get (); }
/** @property */ public boolean get_IsFirstInTransaction ()
public function get IsFirstInTransaction () : boolean
プロパティ値
そのメッセージがトランザクションで送信された最初のメッセージである場合は **true**。それ以外の場合は **false**。
| 例外の種類 | 条件 |
|---|---|
| InvalidOperationException | メッセージは送信されていません。このプロパティは、キューから取得したメッセージでだけ読み込むことができます。 または フィルタ処理されたメッセージ キューが、IsFirstInTransaction プロパティを無視します。 |
受信側アプリケーションは、そのメッセージが 1 つのトランザクションで 1 つのキューに送信された最初のメッセージかどうかを IsFirstInTransaction プロパティを使って確認します。
このプロパティは、メッセージ キュー Version 2.0 以降でだけ使用できます。
トランザクションの境界を確認するために IsFirstInTransaction プロパティと共に使用できるプロパティは、IsLastInTransaction と TransactionId です。前者はメッセージがトランザクションで送信された最後のメッセージかどうかを確認するために使用し、後者はトランザクションの ID を取得するために使用します。
トランザクション内で送信されたメッセージが 1 つだけであるときは、IsFirstInTransaction プロパティと IsLastInTransaction プロパティは、どちらも true に設定されます。
メッセージの IsFirstInTransaction プロパティの値を表示するコード例を次に示します。
// Display the value of the message's IsFirstInTransaction property. // To view this property value, the queue's // MessageReadPropertyFilter.IsFirstInTransaction property must be set // to true before the message is received. Console.WriteLine("Message.IsFirstInTransaction: {0}", orderMessage.IsFirstInTransaction);
// Display the value of the message's IsFirstInTransaction property. // To view this property value, the queue's // MessageReadPropertyFilter.IsFirstInTransaction property must be set // to true before the message is received. Console::WriteLine("Message.IsFirstInTransaction: {0}", orderMessage->IsFirstInTransaction);
// Display the value of the message's IsFirstInTransaction property. // To view this property value, the queue's // MessageReadPropertyFilter.IsFirstInTransaction property must be set // to true before the message is received. Console.WriteLine("Message.IsFirstInTransaction: {0}", System.Convert.ToString(orderMessage.get_IsFirstInTransaction()));
Windows 98, Windows 2000 SP4, Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
.NET Framework
サポート対象 : 2.0、1.1、1.0
.NET Compact Framework
サポート対象 : 2.0
関連項目
Message クラス
Message メンバ
System.Messaging 名前空間
IsLastInTransaction
TransactionId
Transactional