4.4.2 Enlisting in an Existing Transaction

To enlist in an existing transaction, the resource manager needs to have knowledge of the existing transaction, which likely happened as a result of marshaling the transaction from an application to the resource manager.

CONNTYPE_TXUSER_ENLISTMENT: The packet sequence starts when the resource manager initiates a connection by using CONNTYPE_TXUSER_ENLISTMENT.

Field

Value

Value description

MsgTag

0x00000005

MTAG_CONNECTION_REQ

fIsMaster

0x00000001

1

dwConnectionId

0x00000002

2

dwUserMsgType

0x00000003

TXUSER_ENLISTMENT_MTAG_ENLIST

dwcbVarLenData

0x00000000

0

dwReserved1

0xcd64cd64

dwReserved1: 0xcd64cd64

The resource manager then sends a TXUSER_ENLISTMENT_MTAG_ENLIST user message specifying the transaction identifier (guidTx), the resource manager identifier (guidRm), and the resource manager session identifier (guidSession).

Field

Value

Value description

MsgTag

0x00000FFF

MTAG_USER_MESSAGE

fIsMaster

0x00000001

1

dwConnectionId

0x00000002

2

dwUserMsgType

0x00001031

TXUSER_ENLISTMENT_MTAG_ENLIST

dwcbVarLenData

0x00000030

48

dwReserved1

0xcd64cd64

dwReserved1: 0xcd64cd64

guidTx

0x4046037E

0x46C99722

0x06999883

0x35CB4123

4046037e-9722-46c9-9883-99062341cb35

guidRm

0xE7BAEBDF

0x4E2BDC69

0xA1699FF1

0x772859D3

E7BAEBDF-DC69-4E2B-9FF1-69A1D3592877

guidSession

0x8F5204B3

0x466A5FB9

0xAF2DA0B8

0xAAD9CB3F

8F5204B3-5FB9-466A-A0B8-2DAF3FCBD9AA

If the transaction manager can enlist the resource manager in the requested transaction, the transaction manager adds the resource manager to its list of subordinate enlistments and replies to the resource manager with a TXUSER_ENLISTMENT_MTAG_ENLISTED user message.

Field

Value

Value description

MsgTag

0x00000FFF

MTAG_USER_MESSAGE

fIsMaster

0x00000000

0

dwConnectionId

0x00000002

2

dwUserMsgType

0x00001032

TXUSER_ENLISTMENT_MTAG_ENLISTED

dwcbVarLenData

0x00000000

0

dwReserved1

0xcd64cd64

dwReserved1: 0xcd64cd64

The resource manager is now enlisted on the transaction and is now waiting for two-phase commit notifications from the transaction manager. During the time that the resource manager is enlisted on the transaction, the resource manager typically receives from some external application the instructions (that is, work) to perform as part of the transaction.