4.1.4.1 Obtaining a List of XA Superior Transactions to Recover with an XA Subordinate Transaction Manager Facet

This packet sequence uses the XA Superior connection already established with the XA Subordinate Transaction Manager Facet (see section 4.1.1).

To initiate recovery, the XA Superior Transaction Manager sends a XAUSER_CONTROL_MTAG_RECOVER user message. In this example, the XA Superior Transaction Manager specifies to start a new scan (RequestFlags: XARECOVER_START_SCAN) and to return a maximum of five XIDs (totalUOWsRequested: 5).

Field

Value

Value description

MsgTag

0x00000FFF

MTAG_USER_MESSAGE

fIsMaster

0x00000001

1

dwConnectionId

0x00000001

1

dwUserMsgType

0x00004003

XAUSER_CONTROL_MTAG_RECOVER

dwcbVarLenData

0x00000008

8

dwReserved1

0xCD64CD64

dwReserved1: 0xcd64cd64

RequestFlags

0x00000001

XARECOVER_START_SCAN

totalUOWsRequested

0x00000005

5

When the XA Subordinate Transaction Manager Facet receives the XAUSER_CONTROL_MTAG_RECOVER message from the XA Superior Transaction Manager, the XA Subordinate Transaction Manager Facet starts a scan through its list of known XIDs for any transactions that are prepared but for which the XA Subordinate Transaction Manager Facet does not know outcome. The scan is halted if the number of transactions needing recovery reaches five (totalUOWsRequested: 5).

In this example, the XA Subordinate Transaction Manager Facet locates a total of one transaction in need of recovery. The XA Subordinate Transaction Manager Facet sends a XAUSER_CONTROL_MTAG_RECOVER_REPLY user message to the XA Superior Transaction Manager specifying that there it has one transaction that needs recovery (ulTotalUOWs: 1) and that there are no more recovery records to scan (ReplyFlags: XARECOVER_END_OF_RECS). The message also contains the list of one XID (formatId: "0x0000cafe"; gtrid:" 4046037e-9722-46c9-9883-99062341cb35"; bqual:"0") in need of outcome.

Field

Value

Value description

MsgTag

0x00000FFF

MTAG_USER_MESSAGE

fIsMaster

0x00000000

0

dwConnectionId

0x00000001

1

dwUserMsgType

0x00004005

XAUSER_CONTROL_MTAG_RECOVER_REPLY

dwcbVarLenData

0x00000098

152

dwReserved1

0xCD64CD64

dwReserved1: 0xcd64cd64

ReplyFlags

0x00000002

XARECOVER_END_OF_RECS

ulTotalUOWs

0x00000001

1

lenXAIdentifier

0x0000008C

140 (+ 3 bytes of padding)

formatId

0x0000CAFE

formatId: 0x0000cafe

gtridLength

0x00000024

36

bqualLength

0x00000001

1

Data

0x36343034

gtrid:"4046037e-9722-46c9-9883-99062341cb35"

0x65373330

0x3237392D

0x36342D32

0x392D3963

0x2D333838

0x36303939

0x31343332

0x35336263

0x00000030

bqual:"0"

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

When the XA Superior Transaction Manager receives the XAUSER_CONTROL_MTAG_RECOVER_REPLY response from the XA Subordinate Transaction Manager Facet, the XA Superior Transaction Manager iterates through the list of recovery XIDs and locates the corresponding XID to determine the outcome of the transaction.

In this example, the XA Superior Transaction Manager determines that the transaction has aborted and, so it initiates a CONNTYPE_XAUSER_XACT_OPEN connection with the XA Subordinate Transaction Manager Facet.

Field

Value

Value description

MsgTag

0x00000005

MTAG_CONNECTION_REQ

fIsMaster

0x00000001

1

dwConnectionId

0x00000002

2

dwUserMsgType

0x00000042

CONNTYPE_XAUSER_XACT_OPEN

dwcbVarLenData

0x00000000

0

dwReserved1

0xCD64CD64

dwReserved1: 0xcd64cd64

The XA Superior Transaction Manager then sends a XAUSER_XACT_MTAG_OPEN user message. In this example, the XA Superior Transaction Manager specifies its Resource Manager Recovery GUID (guidXaRm: a9b05f39-2368-4c99-94bc-7b5a4bb3f07d) and the XID (formatId: "0x0000cafe"; gtrid:" 4046037e-9722-46c9-9883-99062341cb35"; bqual:"0") that needs recovery.

Field

Value

Value description

MsgTag

0x00000FFF

MTAG_USER_MESSAGE

fIsMaster

0x00000001

1

dwConnectionId

0x00000002

2

dwUserMsgType

0x00004012

XAUSER_XACT_MTAG_OPEN

dwcbVarLenData

0x000000A0

160

dwReserved1

0xCD64CD64

dwReserved1: 0xcd64cd64

guidXaRm

0xA9B05F39

a9b05f39-2368-4c99-94bc-7b5a4bb3f07d

0x4C992368

0x5A7BBC94

0x7DF0B34B

lenXAIdentifier

0x0000008C

140 (+ 3 bytes of padding)

formatId

0x0000CAFE

formatId: 0x0000cafe

gtridLength

0x00000024

36

bqualLength

0x00000001

1

formatId

0x0000CAFE

formatId: 0x0000cafe

gtridLength

0x00000024

36

bqualLength

0x00000001

1

Data

0x36343034

gtrid:"4046037e-9722-46c9-9883-99062341cb35"

0x65373330

0x3237392D

0x36342D32

0x392D3963

0x2D333838

0x36303939

0x31343332

0x35336263

0x00000030

bqual:"0"

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

When the XA Subordinate Transaction Manager Facet receives the XAUSER_XACT_MTAG_OPEN message from the XA Superior Transaction Manager, the XA Subordinate Transaction Manager Facet attempts to locate the XID to its list of known XIDs.

In this example, the XID is located and the XA Subordinate Transaction Manager Facet sends a XAUSER_XACT_MTAG_OPENED user message to the XA Superior Transaction Manager specifying the OleTx transaction identifier (guidTx: 8f5204b3-5fb9-466a-a0b8-2daf3fcbd9aa).

Field

Value

Value description

MsgTag

0x00000FFF

MTAG_USER_MESSAGE

fIsMaster

0x00000000

0

dwConnectionId

0x00000002

2

dwUserMsgType

0x00004013

XAUSER_XACT_MTAG_OPENED

dwcbVarLenData

0x00000010

16

dwReserved1

0xCD64CD64

dwReserved1: 0xcd64cd64

guidTx

0x8F5204B3

8f5204b3-5fb9-466a-a0b8-2daf3fcbd9aa

0x466A5FB9

0xAF2DA0B8

0xAAD9CB3F

When the XA Superior Transaction Manager receives the XAUSER_XACT_MTAG_OPENED response from the XA Subordinate Transaction Manager Facet, the XA Superior Transaction Manager sends a XAUSER_XACT_MTAG_ABORT user message to the XA Subordinate Transaction Manager Facet.

Field

Value

Value description

MsgTag

0x00000FFF

MTAG_USER_MESSAGE

fIsMaster

0x00000001

1

dwConnectionId

0x00000002

2

dwUserMsgType

0x00004014

XAUSER_XACT_MTAG_ABORT

dwcbVarLenData

0x00000000

0

dwReserved1

0xCD64CD64

dwReserved1: 0xcd64cd64

When the XA Subordinate Transaction Manager Facet receives the XAUSER_XACT_MTAG_ABORT message from the XA Superior Transaction Manager, the XA Subordinate Transaction Manager Facet signals the Core Transaction Manager Facet that the transaction has aborted.

When the XA Subordinate Transaction Manager Facet receives Rollback Complete notification from the Core Transaction Manager Facet, the XA Subordinate Transaction Manager Facet sends a XAUSER_XACT_MTAG_REQUEST_COMPLETED user message to XA Superior Transaction Manager indicating that the XA Subordinate Transaction Manager Facet has aborted the transaction.

Field

Value

Value description

MsgTag

0x00000FFF

MTAG_USER_MESSAGE

fIsMaster

0x00000000

0

dwConnectionId

0x00000002

2

dwUserMsgType

0x00004017

XAUSER_XACT_MTAG_REQUEST_COMPLETED

dwcbVarLenData

0x00000000

0

dwReserved1

0xCD64CD64

dwReserved1: 0xcd64cd64

When the XA Superior Transaction Manager receives the XAUSER_XACT_MTAG_REQUEST_COMPLETED response from the XA Subordinate Transaction Manager Facet, the XA Superior Transaction Manager closes the connection by initiating the Disconnect sequence.