10.27.03

ITransactedSession Interface

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.

Definition

Namespace: SolaceSystems.Solclient.Messaging
Assembly: SolaceSystems.Solclient.Messaging (in SolaceSystems.Solclient.Messaging.dll) Version: 10.27.0
C#
public interface ITransactedSession : IDisposable
Implements
IDisposable

Properties

SessionName The name of the transacted session

Methods

Commit Commits the active transaction on the given transacted session. This method blocks the calling thread until a response is received or the operation fails.
CreateFlow(FlowProperties, IEndpoint, ISubscription, EventHandlerMessageEventArgs, EventHandlerFlowEventArgs) Creates a consumer flow IFlow on the given transacted session. This method calls CreateFlow(FlowProperties, IEndpoint, ISubscription, EventHandlerMessageEventArgs, EventHandlerFlowEventArgs, EndpointProperties) for with null endpointProperties, therefore it does not allow the user of this method to specify the EndpointProperties when binding and implicilty creating a non-durable endpoint.
CreateFlow(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
DisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from IDisposable)
Rollback 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.
Send 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.

See Also