Entering content frame

This graphic is explained in the accompanying text Closing the JMS Connection Locate the document in its SAP Library structure

Use

You perform this operation when you want to finish using the JMS connection, and the objects used must be released. This means that the Session and the Connection that are created must be closed. You can choose one of two ways: manually close the Session and then the Connection, or close the Connection object only. In the second case, the J2EE Engine JMS Provider automatically closes the Session.

Procedure

When the connection is closed, the session object and all the connection objects used are released. If you are using point-to-point connection use the following code to close the Connection object:

This graphic is explained in the accompanying text

// Close the queue connection

queueConnection.close();

If you are using the publish-subscribe connection, close the Connection in the same way:

This graphic is explained in the accompanying text

// Close the topic connection

topicConnection.close();

Result

The JMS connection is closed and the Session is automatically stopped.

 

Leaving content frame