TIBCO EMS .NET API 8.6
TIBCO EMS .NET API 8.6
|
The EMSDTCSession class represents a session of the client within the server. Only EMSDTCSession's are allowed to participate in MSDTC distributed transactions. More...
Inherits XASession.
Public Member Functions | |
new Session | GetSession () |
Returns this session, that would allow to create producers and consumers More... | |
override void | Commit () |
Not valid for EMSDTCSession, throws InvalidOperationException More... | |
override void | Rollback () |
Not valid for EMSDTCSession, throws InvalidOperationException More... | |
The EMSDTCSession class represents a session of the client within the server. Only EMSDTCSession's are allowed to participate in MSDTC distributed transactions.
EMSDTCSession is a single-threaded context for producing and consuming messages. Typically applications create EMSDTCSessions and then producers and consumers on the EMSDTCSession. Message Producers and consumers that are then created within this session can produce and consume as long as they are done within an ambient transaction (Created via the System.Transactions.TransactionScope or System.Transactions.CommittableTransaction).
General:
When a message producer publishes its first message as part of a distributed transaction (started via the TransactionSope of via the CommittableTransaction) or a consumer consumes its first message as part of a distributed transaction. The EMS .NET client library registers an EnlistmentNotification object with MSDTC for this session. When the producer or the consumer is done with its unit of work, it commits the distributed transaction. The act of commiting this distributed transaction will then result in Microsoft DTC calling back ino the EnlistmentNotification object to complete the transaction. On a successful commit or rollback of the distributed transaction, the session is now free to have more work done in another transaction.
Recovery:
If during the transaction commit process, the resource manager fails (i.e after a successful prepare, but before the Microsoft DTC had the chance to commit the transaction) then the client will have to close the connection and create it again in order for the prepared transactions to be completed (that happens internally via a re-enlistment processs and the MSDTC either issuing a commit or a rollback based on other participants in the distributed transaction). For more information on the re-enlistment process please see the documentation on System.Transactions.TransactionManager.Reenlist.
Exceptions:
Following will result in IllegalStateException:
A typical application produces or consumes messages as part of a transaction scope. In the example below, If the producer's EMSDTCSession is not already enlisted for the current ambient transaction, the first publish will result in an automatic enlistment.
Example:
|
inline |
Not valid for EMSDTCSession, throws InvalidOperationException
|
inline |
Returns this session, that would allow to create producers and consumers
|
inline |
Not valid for EMSDTCSession, throws InvalidOperationException