1.3.3.4 Terminating a Session

Termination requires a nested series of RPCs between the IXnRemote interfaces of the two partners. Either partner has the option to terminate the session. If the primary partner decides to terminate the session, the session termination proceeds immediately. If the secondary partner decides to terminate the session, it sends a BeginTearDown request to the primary partner, which has the effect of informing the primary to terminate the session.

The primary partner begins the handshake series by making a TearDownContext call to the secondary partner. The secondary partner responds by freeing some of its local state and making a corresponding TearDownContext callback to the primary partner.

On receiving this callback, the primary partner frees its local state associated with the session.

Note that the exact conditions under which a partner decides to terminate a session are outside the scope of the MSDTC Connection Manager: OleTx Transports Protocol; it is the responsibility of the protocol being layered above the MSDTC Connection Manager: OleTx Transports Protocol to provide mechanisms for determining the lifetime of a session.