4.4.1 Registering with the Transaction Manager as a Resource Manager
Before a resource manager can participate in transactional work, it needs to register as a resource manager with a transaction manager.
CONNTYPE_TXUSER_RESOURCEMANAGER: The packet sequence starts when the resource manager initiates a CONNTYPE_TXUSER_RESOURCEMANAGER connection.
|
Field |
Value |
Value description |
|---|---|---|
|
MsgTag |
0x00000005 |
MTAG_CONNECTION_REQ |
|
fIsMaster |
0x00000001 |
1 |
|
dwConnectionId |
0x00000002 |
2 |
|
dwUserMsgType |
0x00000005 |
CONNTYPE_TXUSER_RESOURCEMANAGER |
|
dwcbVarLenData |
0x00000000 |
0 |
|
dwReserved1 |
0xcd64cd64 |
dwReserved1: 0xcd64cd64 |
The resource manager then sends a TXUSER_RESOURCEMANAGER_MTAG_CREATE user message that specifies a GUID that uniquely identifies the resource manager (guidRm) and a session GUID that uniquely identifies this session of the resource manager (guidSession). The session GUID can be either a unique GUID that is created each time the resource manager starts up, or a NULL GUID.
|
Field |
Value |
Value description |
|---|---|---|
|
MsgTag |
0x00000FFF |
MTAG_USER_MESSAGE |
|
fIsMaster |
0x00000001 |
1 |
|
dwConnectionId |
0x00000002 |
2 |
|
dwUserMsgType |
0x00001051 |
TXUSER_RESOURCEMANAGER_MTAG_CREATE |
|
dwcbVarLenData |
0x00000020 |
32 |
|
dwReserved1 |
0xcd64cd64 |
dwReserved1: 0xcd64cd64 |
|
guidRm |
0xE7BAEBDF 0x4E2BDC69 0xA1699FF1 0x772859D3 |
E7BAEBDF-DC69-4E2B-9FF1-69A1D3592877 |
|
guidSession |
0x8F5204B3 0x466A5FB9 0xAF2DA0B8 0xAAD9CB3F |
8F5204B3-5FB9-466A-A0B8-2DAF3FCBD9AA |
If guidRm does not identify a resource manager already registered with the transaction manager, the transaction manager adds the resource manager to its list of registered resource managers and sends to the resource manager a TXUSER_RESOURCEMANAGER_MTAG_REQUEST_COMPLETE user message.
|
Field |
Value |
Value description |
|---|---|---|
|
MsgTag |
0x00000FFF |
MTAG_USER_MESSAGE |
|
fIsMaster |
0x00000000 |
0 |
|
dwConnectionId |
0x00000002 |
2 |
|
dwUserMsgType |
0x00001053 |
TXUSER_RESOURCEMANAGER_MTAG_REQUEST_COMPLETE |
|
dwcbVarLenData |
0x00000000 |
0 |
|
dwReserved1 |
0xcd64cd64 |
dwReserved1: 0xcd64cd64 |
The resource manager needs to keep this connection open for the duration of its lifetime. If the connection is terminated, any unprepared transactions are aborted.