tibemsSession


Type

Purpose

Organizing context for message activity.

Remarks

Sessions combine several roles:

Single Thread

The JMS specification restricts programs to use each session within a single thread.

Associated Objects

The same single-thread restriction applies to objects associated with a session—namely, messages, message consumers, durable subscribers, message producers, queue browsers, and temporary destinations (however, static and dynamic destinations are exempt from this restriction).

Corollary

One consequence of this rule is that all the consumers of a session must deliver messages in the same mode—either synchronously or asynchronously.

Asynchronous

In asynchronous delivery, the program registers message handler events or message listeners with the session’s consumer objects. An internal dispatcher thread delivers messages to those event handlers or listeners (in all the session’s consumer objects). No other thread may use the session (nor objects created by the session).

Synchronous

In synchronous delivery, the program explicitly begins a thread for the session. That thread processes inbound messages and produces outbound messages, serializing this activity among the session’s producers and consumers. Functions that request the next message (such as tibemsMsgConsumer_Receive) can organize the thread’s activity.

Close

The only exception to the rule restricting session calls to a single thread is the function tibemsSession_Close; programs can call Close from any thread at any time.

Transactions

A session has either transaction or non-transaction semantics. When a program specifies transaction semantics, the session object cooperates with the server, and all messages that flow through the session become part of a transaction.

After these actions, both Commit and Rollback immediately begin a new transaction.

(Sheet 1 of 2)

Function
Description
Page
Messages
312
318
321
324
Destinations
311
322
323
Consumers & Producers
313
315
320
332
Transactions
310
331
Other
309
329

Related Types

tibemsQueueSession

tibemsTopicSession


TIBCO Enterprise Message Service™ C and COBOL Reference
System Release 4.3, February 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com