4.6.2 Reenlisting in In-Doubt Transactions
To reenlist in any transaction that is in-doubt, the resource manager establishes a CONNTYPE_TXUSER_REENLIST connection with its transaction manager.
CONNTYPE_TXUSER_REENLIST: The packet sequence starts when the resource manager initiates a CONNTYPE_TXUSER_REENLIST connection.
Field |
Value |
Value description |
---|---|---|
MsgTag |
0x00000005 |
MTAG_CONNECTION_REQ |
fIsMaster |
0x00000001 |
1 |
dwConnectionId |
0x00000002 |
2 |
dwUserMsgType |
0x00000006 |
CONNTYPE_TXUSER_REENLIST |
dwcbVarLenData |
0x00000000 |
0 |
dwReserved1 |
0xcd64cd64 |
dwReserved1: 0xcd64cd64 |
For each in-doubt transaction, the resource manager sends a TXUSER_REENLIST_MTAG_REENLIST user message specifying the transaction identifier (guidTx), the time-out (in milliseconds) that it will wait for notification, and the resource manager identifier (guidRm). For this sample, the resource manager will wait 1 second (or 1000 milliseconds).
Field |
Value |
Value description |
---|---|---|
MsgTag |
0x00000FFF |
MTAG_USER_MESSAGE |
fIsMaster |
0x00000001 |
1 |
dwConnectionId |
0x00000002 |
2 |
dwUserMsgType |
0x00001061 |
TXUSER_REENLIST_MTAG_REENLIST |
dwcbVarLenData |
0x00000024 |
36 |
dwReserved1 |
0xcd64cd64 |
dwReserved1: 0xcd64cd64 |
guidTx |
0x4046037E 0x46C99722 0x06999883 0x35CB4123 |
4046037e-9722-46c9-9883-99062341cb35 |
ulTimeout |
0x000003E8 |
1000 |
guidRm |
0xE7BAEBDF 0x4E2BDC69 0xA1699FF1 0x772859D3 |
E7BAEBDF-DC69-4E2B-9FF1-69A1D3592877 |
When transaction manager receives the reenlist request, it attempts to find the transaction in its list of known transactions. If the transaction manager cannot locate the transaction, it assumes that the transaction aborted and replies to the resource manager with a TXUSER_REENLIST_MTAG_REENLIST_ABORTED user message.
Field |
Value |
Value description |
---|---|---|
MsgTag |
0x00000FFF |
MTAG_USER_MESSAGE |
fIsMaster |
0x00000000 |
0 |
dwConnectionId |
0x00000002 |
2 |
dwUserMsgType |
0x00001062 |
TXUSER_REENLIST_MTAG_REENLIST_ABORTED |
dwcbVarLenData |
0x00000000 |
0 |
dwReserved1 |
0xcd64cd64 |
dwReserved1: 0xcd64cd64 |
If the transaction manager can locate the transaction, the transaction manager attempts to determine outcome. The transaction manager replies to the resource manager with a TXUSER_REENLIST_MTAG_REENLIST_COMMITTED or TXUSER_REENLIST_MTAG_REENLIST_ABORTED user message, as appropriate.
Field |
Value |
Value description |
---|---|---|
MsgTag |
0x00000FFF |
MTAG_USER_MESSAGE |
fIsMaster |
0x00000000 |
0 |
dwConnectionId |
0x00000002 |
2 |
dwUserMsgType |
0x00001063 |
TXUSER_REENLIST_MTAG_REENLIST_COMMITED |
dwcbVarLenData |
0x00000000 |
0 |
dwReserved1 |
0xcd64cd64 |
dwReserved1: 0xcd64cd64 |
If the transaction manager is unable to determine outcome in the time-out period, the transaction manager replies to the resource manager with a TXUSER_REENLIST_MTAG_REENLIST_TIMEOUT user message.
Field |
Value |
Value description |
---|---|---|
MsgTag |
0x00000FFF |
MTAG_USER_MESSAGE |
fIsMaster |
0x00000000 |
0 |
dwConnectionId |
0x00000002 |
2 |
dwUserMsgType |
0x00001064 |
TXUSER_REENLIST_MTAG_REENLIST_TIMEOUT |
dwcbVarLenData |
0x00000000 |
0 |
dwReserved1 |
0xcd64cd64 |
dwReserved1: 0xcd64cd64 |
After the resource manager determines the outcome from the transaction manager, it performs any remaining commit or abort work, as appropriate. If the resource manager receives a time-out notification, it needs to maintain the in-doubt entries in its log unchanged. The resource manager will attempt to determine the outcome of these in-doubt transactions next time it performs recovery.
For any remaining in-doubt transactions, the resource manager needs to perform the previous steps for each in-doubt transaction.
If there are no more in-doubt transactions, the resource manager informs the transaction manager that it has completed its recovery process. The resource manager then initiates the disconnect sequence on this connection.