|
Summary: Create a transacted JMS session automatically starts a local transaction.
OverviewIn 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). 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);
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.
Add Comment