Delen via


MSMQMessage.IsFirstInTransaction2

 

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 IsFirstInTransaction2 property of the MSMQMessage object indicates whether the message was the first message sent to the queue within a specific transaction.

IsFirstInTransaction2 is a Boolean property that supersedes the non-Boolean MSMQMessage.IsFirstInTransaction property.

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

Property Value

A Boolean set to one of the following values:

True (-1)

The message was the first message sent in the transaction.

False (0)

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

Remarks

IsFirstInTransaction2 is used by receiving applications to verify that a message was the first message sent in a single transaction to a single queue.

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 IsFirstInTransaction2 and MSMQMessage.IsLastInTransaction2 are set.

IsFirstInTransaction2 supersedes MSMQMessage.IsFirstInTransaction and should be used whenever possible. IsFirstInTransaction2 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 IsFirstInTransaction2 property.

Equivalent API Function Property

With API function calls, the equivalent property is PROPID_M_FIRST_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.IsLastInTransaction2
MSMQMessage.TransactionId
PROPID_M_FIRST_IN_XACT