MessageQueueTransactionType 列舉

定義

指定訊息佇列交易型別。Specifies the type of a Message Queuing transaction.

public enum class MessageQueueTransactionType
public enum MessageQueueTransactionType
[System.Serializable]
public enum MessageQueueTransactionType
type MessageQueueTransactionType = 
Public Enum MessageQueueTransactionType
繼承
MessageQueueTransactionType
屬性

欄位

Automatic 1

Microsoft Transaction Server (MTS) 或 COM+ 1.0 服務所使用的交易型別。A transaction type used for Microsoft Transaction Server (MTS) or COM+ 1.0 Services. 如果已經有一個 MTS 交易內容,在傳送或接收訊息時將會使用它。If there is already an MTS transaction context, it will be used when sending or receiving the message.

None 0

作業不是可交易的。Operation will not be transactional.

Single 3

單一內部交易所使用的交易型別。A transaction type used for single internal transactions.

備註

當您使用 MessageQueue 類別之 Send 的多載或是採用 ReceiveByCorrelationId參數的 Receive 方法(包括 ReceiveByIdtransactionType)來讀取或寫入訊息時,您可以指定與佇列互動的方式。When you read or write a message using an overload of the MessageQueue class's Send or Receive methods (including ReceiveById and ReceiveByCorrelationId) that takes a transactionType parameter, you can specify how you are interacting with the queue. Automatic 可讓您從外部交易傳送和接收(例如當您與資料庫應用程式互動時),而 Single 用於單一內部訊息佇列交易。Automatic enables you to send and receive from external transactions (such as when you are interacting with database applications), while Single is used for single internal Message Queuing transactions.

None 可讓您從交易外部的交易式佇列接收訊息,或將交易式訊息傳送至非交易式佇列。None enables you to receive a message from a transactional queue outside of a transaction or send a transactional message to a non-transactional queue. 例如,當您在單一交易內路由傳送數個訊息時,這會很有用。This is useful, for example, when routing several messages sent within a single transaction.

如果您想要使用內部訊息佇列交易(而不是單一內部交易)來傳送或接收訊息,請建立 MessageQueueTransaction 類別的實例,並將它傳遞至 Send 的多載,或採用 transaction 參數而不是採用 transactionType 參數的 Receive 方法。If you want to send or receive a message using an internal Message Queuing transaction but not a single internal transaction, create an instance of the MessageQueueTransaction class and pass it into an overload of the Send or Receive methods that takes a transaction parameter rather than one that takes a transactionType parameter.

適用於

另請參閱