Starting Local Transaction in JMS

  GigaSpaces 5.X

Documentation Home
Quick Start Guide
Release Notes

Previous release

  Search Here
Searching GigaSpaces Platform 5.X Documentation

                                               

Summary: Create a transacted JMS session automatically starts a local transaction.

Overview

In order to send or consume messages within a local transaction you must first create a transacted session. You create it exactly the same way as a non-transacted session, with QueueConnection.createQueueSession()}}or {{TopicConnection.createTopicSession(), but with one exception. Set the isTransacted argument of these methods to true (See Transacted Sessions).
The code below demonstrates how to create a transacted QueueSession:

boolean isTransacted = true;
int acknowledgeMode = 0;
QueueSession queueSession =
queueConnection.createQueueSession(isTransacted,acknowled
geMode);

The code below demonstrates how to create a transacted TopicSession:

boolean isTransacted = true;
int acknowledgeMode = 0;
TopicSession TopicSession =
topicConnection.createTopicSession(isTransacted,acknowled geMode);
When you set the isTransacted argument to true, ignore acknowledgeMode.

The creation of a transacted session automatically starts a local transaction. There is no extra method necessary.


Wiki Content Tree


Your Feedback Needed!

We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.

Labels

 
(None)