Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

create session object from ConnectionFactory

 
Kiran Yadav
Ranch Hand
Posts: 35
Eclipse IDE Firefox Browser Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In to create session object from ConnectionFactory for JMS implementation we have method called createSession() with two parameters.

In documentation the following details is given :

public Session createSession(boolean transacted,
int acknowledgeMode)
throws JMSExceptionCreates a Session object.

Parameters:
transacted - indicates whether the session is transacted
acknowledgeMode - indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values are Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, and Session.DUPS_OK_ACKNOWLEDGE.


So kindly help me in understanding regarding these two method parameters - boolean transacted and int acknowledgeMode.
 
Kiran Yadav
Ranch Hand
Posts: 35
Eclipse IDE Firefox Browser Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For first parameter i.e. boolean transacted , my understanding is ,

The first parameter of the method specifies whether the session is transactional.
This means that the requests for messages to be sent won’t be
realized until either the session’s commit method is called or the session is closed.
(If the session isn’t transactional, messages will be sent as soon as the send method
is invoked.)


Is my understanding ok.

Will you please help me in understanding second parameter i.e. int acknowledgeMode
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic