次の方法で共有


MSMQMessage.IsLastInTransaction2

 

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

(Introduced in MSMQ 3.0.) The IsLastInTransaction2 property of the MSMQMessage object indicates whether the message was the last message sent to the queue within a specific transaction.

IsLastInTransaction2 is a Boolean property that supersedes the non-Boolean MSMQMessage.IsLastInTransaction property.

Data type: Boolean
Run-time access: Read-only
Property IsLastInTransaction2 As Boolean  

Property Value

A Boolean set to one of the following values:

True (-1)

The message was the last message sent in the transaction.

False (0)

The message was not the last message sent in the transaction.

Remarks

IsLastInTransaction2 is used by receiving applications to verify that a message was the last message sent to the queue within a specific transaction.

Message Queuing provides the following properties for verifying the boundaries (the first and last message sent to a specific queue) of a transaction.

  • MSMQMessage.IsFirstInTransaction2

    Indicates whether the message was the first message sent to the queue within a specific transaction.

  • MSMQMessage.TransactionId

    Indicates whether the message is part of a specific transaction.

  • MSMQMessage.IsLastInTransaction2

    Indicates whether the message was the last message sent to the queue within a specific transaction.

If only one message is sent in a transaction, both IsLastInTransaction2 and MSMQMessage.IsFirstInTransaction2 are set.

IsLastInTransaction2 supersedes MSMQMessage.IsLastInTransaction and should be used whenever possible. IsLastInTransaction2 returns Boolean values that are consistent with the Microsoft® Visual Basic® Boolean data type. Otherwise, both properties are functionally equivalent.

In C++ COM applications, you must use a smart pointer to the IMSMQMessage3 interface to expose the IsLastInTransaction2 property.

Equivalent API Function Property

With API function calls, the equivalent property is PROPID_M_LAST_IN_XACT.

For information on See
How transaction boundaries can be used Checking for Transaction Boundaries when Receiving Messages

Requirements

Windows NT/2000/XP: Included in Windows XP and Windows Server 2003.

Windows 95/98/Me: Unsupported.

Header: Declared in Mqoai.h.

Library: Use Mqoa.lib.

See Also

MSMQMessage
MSMQMessage.IsFirstInTransaction2
MSMQMessage.TransactionId
PROPID_M_LAST_IN_XACT