Sdílet prostřednictvím


MSMQTransaction

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

The MSMQTransaction object identifies an underlying transaction object obtained externally using an MSMQCoordinatedTransactionDispenser object, or created internally using an MSMQTransactionDispenser object.

The MSMQTransaction object provides methods for committing or terminating the transaction, as well as two read-only properties that represent the underlying transaction object.

To use an MSMQTransaction object, it must be specified as the Transaction argument of one of the following methods.

When sending messages:

When retrieving messages without using message lookup identifiers:

When retrieving messages using message lookup identifiers:

Methods

The MSMQTransaction object defines the following methods.

Method Description
MSMQTransaction.Abort Aborts the transaction associated with the MSMQTransaction object.
MSMQTransaction.Commit Commits the transaction represented by the MSMQTransaction object.
MSMQTransaction.InitNew (Introduced in MSMQ 2.0.) Initializes an MSMQTransaction object based on an existing transaction.

Properties

The MSMQTransaction object defines the following properties.

Property Description
MSMQTransaction.ITransaction (Introduced in MSMQ 3.0.) Returns the transaction interface on the underlying transaction object associated with the MSMQTransaction object.

Run-time access: Read-only

Data type: Variant
MSMQTransaction.Transaction Provides the underlying transaction object used by the transaction.

Run-time access: Read-only

Data type: Long

Requirements

Windows NT/2000/XP: Included in Windows NT 4.0 SP3 and later.

Windows 95/98/Me: Included in Windows 95 and later.

Header: Declared in Mqoai.h.

Library: Use Mqoa.lib.

See Also

Message Queuing COM Components
MSMQCoordinatedTransactionDispenser
MSMQTransactionDispenser
MSMQQueue.Receive
MSMQQueue.ReceiveByLookupId
MSMQQueue.ReceiveCurrent
MSMQQueue.ReceiveFirstByLookupId
MSMQQueue.ReceiveLastByLookupId
MSMQQueue.ReceiveNextByLookupId
MSMQQueue.ReceivePreviousByLookupId
MSMQMessage.Send