Progress
External Program
Interfaces


Connections and Sessions

In JMS, a Java client can create several sessions per connection. Each session is a single-threaded context for both sending and receiving messages. Since the 4GL is single-threaded, there is no compelling reason for multiple sessions per connection, nor for exposing the distinction between sessions and connections. In the context of the 4GL–JMS API, the combination of a session and a connection is called a session.

When more than one session per connection is required (for example, to send and receive messages concurrently), a second session is used implicitly on the SonicMQ Adapter broker, transparently to the 4GL programmer.

Creating a JMS Session

These are the general steps to create a JMS session in the 4GL:

  1. Run jms/pubsubsession.p or jms/ptpsession.p persistently with the SonicMQ Adapter connection parameters as INPUT CHAR parameters.
  2. Set JMS attributes and parameters by calling internal procedures in the session procedure (optional).
  3. Start the actual JMS connection and session by calling the beginSession() internal session procedure.
NOTE: Session attributes cannot be modified after calling beginSession().

Creating a Session In a WebClient

A WebClient 4GL application connects to the AppServer and the SonicMQ Adapter through an HTTP server. To connect to the SonicMQ Adapter through HTTP, the input parameter to the jms/ptpsession.p or the jms/pubsubsession.p procedure call must be in the “–URL <url>” format and include the service name of the SonicMQ Adapter. If the URL format is used, the SonicMQ Adapter’s service name is part of the URL and the setAdapterService 4GL–JMS API call is ignored. An example of a valid URL parameter is:

-URL http://host1:3099/uri?AppService=adapter.progress.jms 

In sites where a proxy is used as part of the firewall configuration, the 4GL application might have to specify a proxy HTTP service in addition to specifying the URL connection parameter of the HTTP server. These parameters are specified as Progress startup parameters (–proxyHost and –proxyPort) and are used for all of a WebClient’s AppServer and SonicMQ Adapter connections.

The other WebClient Session object methods are identical to those for a nonWebClient session.

For more information on connecting to the AppServer, see the chapter on the AppServer Internet Adapter in the Progress Version 9 Product Update Bulletin .

Deleting a JMS Session

An application calls deleteSession in the Session object to close and delete the session. This call terminates the underlying JMS connection and sessions, disconnects the 4GL client from the SonicMQ Adapter, deletes all the Message Consumer objects, and deletes the session’s persistent procedure.

The deleteSession call does not delete the 4GL Message objects associated with the session; those messages remain for possible use with other sessions.

Creating Multiple Sessions

A 4GL application can create and use multiple Session objects concurrently.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095