Collapse All Expand All

.NET Framework Class Library
EMSDTCConnection Class See Also

[TIBCO.EMS .NET client library 5.1 documentation]

Returns an EMSMSDTCSession. Only EMSDTCSession's will be allowed to participate in MSDTC distributed transactions.

Namespace: TIBCO.EMS
Assembly: TIBCO.EMS (in TIBCO.EMS.dll)

# Syntax

    public EMSDTCSession CreateEMSDTCSession()

    Public Function CreateEMSDTCSession As EMSDTCSession

    public:
    EMSDTCSession^ CreateEMSDTCSession()

#### Return Value

An EMSDTCSession

# Remarks

The presence of an ambient transaction will cause the session to be automatically enlisted with Microsoft DTC when the session's producer produces or consumer consumes the first message within a transaction scope.

Before producing or consuming messages (from producers/consumers created off this EMSDTCSession) one has to make sure that there is already an ambient transaction started. Please see System.Transactions.TransactionScope or System.Transactions.CommittableTransaction on how to start a an ambient transaction.

| Copy Code
--- | ---
                    Example:
                    EMSDTCConnectionFactory fc = new EMSDTCConnectionFactory("tcp://localhost:7222");
                    fc.ClientId                = "test-clientId";
                    EMSDTConnection dtcConn    = fc.CreateEMSDTCConnection();
                    EMSDTCSession   dtcSess    = dtcConn.CreateEMSDTCSession();

# See Also

EMSDTCConnection Class
TIBCO.EMS Namespace