Click or drag to resize

ITransactedSession Interface

version: 10.9.0
ITransactedSession groups a number of Guaranteed Delivery flows into transactions. Once successfully created, an ITransactedSession instance has an in-progress transaction but no subordinate Guarenteed Delivery consumer flows. Consumer flows can be created by calling CreateFlow(). Transacted sessions are not thread-safe and should not be used by mulitple application threads. The legal threading model usage of transacted sessions is limited to:
  • If messages are received over the message dispatcher thread (async), client applications must invoke commit/rollback/sendMsg from the context of that thread (i.e. in the context of the message dispatcher thread CreateMessageDispatcher).
  • If messages are received from an application thread by calling ReceiveMsg(Int32) directly, commit/rollback/sendMsg/receiveMsg functions must be called in the context of the same application thread.

Namespace:  SolaceSystems.Solclient.Messaging
Assembly:  SolaceSystems.Solclient.Messaging (in SolaceSystems.Solclient.Messaging.dll) Version: 10.9.0
Syntax
public interface ITransactedSession : IDisposable

The ITransactedSession type exposes the following members.

Properties
  NameDescription
Public propertySessionName
The name of the transacted session
Top
Methods
  NameDescription
Public methodCommit
Commits the active transaction on the given transacted session. This method blocks the calling thread until a response is received or the operation fails.
Public methodCreateFlow(FlowProperties, IEndpoint, ISubscription, EventHandlerMessageEventArgs, EventHandlerFlowEventArgs)
Public methodCreateFlow(FlowProperties, IEndpoint, ISubscription, EventHandlerMessageEventArgs, EventHandlerFlowEventArgs, EndpointProperties)
Creates a consumer flow IFlow on the given transacted session. If messageEventHandler delegate is provided, messages received on the flow are dispatched to the message callback delegate in the context of the message dispatcher thread (CreateMessageDispatcher), otherwise messages received on this consumer flow are queued internally; in this case client applications must call ReceiveMsg(Int32) directly to retrieve any internally queued messages. Unlike other (or non-transacted) flows, events and messages received on a transacted flow are delivered in the contexts of two different threads. Events received on flows are still delivered in the context of the IContext thread (IContext). Messages received on flows are dispatched to the messageEventHandler delegate in the context of the message dispatcher thread or retrieved by calling ReceiveMsg(Int32) directly in the context of an application thread. The following flow properties are not supported: AckModeAutoAck
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from IDisposable.)
Public methodRollback
Rolls back the active transaction of the given transacted session. This method blocks the calling thread until a response is received or the operation fails.
Public methodSend
Sends a guaranteed message on the transacted session. In order to send messages on a Transacted Session, a default publisher flow has to be created by enabling the Transacted Session property HasPublisher during the transacted session creation. Send(IMessage) returns SOLCLIENT_OK when the message has been successfully copied to the transmit buffer or underlying transport. Successful commits acknowledge published messages delivered to the Solace messaging appliance.
Top
See Also