4.1.1 Beginning a Transaction

This packet sequence is initiated by starting a connection on a transport session between an application and a transaction manager.

CONNTYPE_TXUSER_BEGIN2: The packet sequence starts when an application initiates a connection using CONNTYPE_TXUSER_BEGIN2.

Field

Value

Value description

MsgTag

0x00000005

MTAG_CONNECTION_REQ

fIsMaster

0x00000001

1

dwConnectionId

0x00000001

1

dwUserMsgType

0x00000028

CONNTYPE_TXUSER_BEGIN2

dwcbVarLenData

0x00000000

0

dwReserved1

0xcd64cd64

dwReserved1: 0xcd64cd64

The application then sends a TXUSER_BEGIN2_MTAG_BEGIN user message specifying the isolation level, time-out, transaction description, and isolation flag. For this example, the application requests a transaction with ISOLATIONLEVEL_SERIALIZABLE, a time-out of 60 seconds, a description of "sample transaction", and ISOFLAG_RETAIN_DONTCARE.

Field

Value

Value description

MsgTag

0x000000FF

MTAG_USER_MESSAGE

fIsMaster

0x00000001

1

dwConnectionId

0x00000001

1

dwUserMsgType

0x00006002

TXUSER_BEGIN2_MTAG_BEGIN

dwcbVarLenData

0x00000034

52

dwReserved1

0xcd64cd64

dwReserved1: 0xcd64cd64

isoLevel

0x00100000

ISOLATIONLEVEL_SERIALIZABLE

dwTimeout

0x0000EA60

60000

szDesc

0x706D6173

0x7420656C

0x736E6172

0x69746361

0x00006E6F

0x00000000

0x00000000

0x00000000

0x00000000

0x00000000

"sample transaction"

isoFlags

0x00000005

ISOFLAG_RETAIN_DONTCARE

When the transaction manager receives the TXUSER_BEGIN2_MTAG_BEGIN message from the application, the transaction manager attempts to create a transaction object with a globally unique identifier (GUID) as its identifier. If the transaction manager successfully creates the transaction, it sends a TXUSER_BEGIN2_MTAG_SINK_BEGUN user message to the application specifying the transaction identifier as the guidTx field (for example, 4046037e-9722-46c9-9883-99062341cb35), and the transaction manager adds the transaction to its list of known transaction objects.

Field

Value

Value description

MsgTag

0x00000FFF

MTAG_USER_MESSAGE

fIsMaster

0x00000000

0

dwConnectionId

0x00000001

1

dwUserMsgType

0x00006006

TXUSER_BEGIN2_MTAG_SINK_BEGUN

dwcbVarLenData

0x00000010

16

dwReserved1

0xcd64cd64

dwReserved1: 0xcd64cd64

guidTx

0x4046037E

0x46C99722

0x06999883

0x35CB4123

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