GeeCON Prague 2014*
The moose likes EJB and other Java EE Technologies and the fly likes create session object from ConnectionFactory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "create session object from ConnectionFactory " Watch "create session object from ConnectionFactory " New topic
Author

create session object from ConnectionFactory

Kiran Yadav
Ranch Hand

Joined: Nov 02, 2011
Posts: 35

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

Joined: Nov 02, 2011
Posts: 35

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
 
GeeCON Prague 2014
 
subject: create session object from ConnectionFactory