About Question enthuware.oce-ejbd.v6.2.421 :

Moderator: admin

Post Reply
himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

About Question enthuware.oce-ejbd.v6.2.421 :

Post by himaiMinh »

This is out of the scope of the question.
According to the spec , the parameters of createQueueSession (false, Session.AUTO_ACKNOWLEDGE) are ignored by the container.
So, regardless the first parameter transacted is true or false, it is still ignored?

If it is ignored, is createQueueSession implemented in a transaction or not?

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.421 :

Post by admin »

As per 13.3.5:
Because the container manages the transactional enlistment of JMS sessions on behalf of a bean, the parameters of the createSession(boolean transacted, int acknowledgeMode), createQueueSession(boolean transacted, int acknowledgeMode) and createTopicSession(boolean transacted, int acknowledgeMode) methods are ignored. It is recommended that the Bean Provider specify that a session is transacted, but provide 0 for the value of the acknowledgment mode.
So yes, the parameters are ignored.
I am not sure I understand your question, "is createQueueSession implemented in a transaction or not?"
-Paul.
If you like our products and services, please help us by posting your review here.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.421 :

Post by himaiMinh »

Hi, admin. Thanks.
createQueueSession (false, ....) means the session is a not a transaction. But when this boolean false is ignored by EJB container, is this queue session still in a transaction or not?

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.421 :

Post by admin »

No, a parameter of false means nothing. As the spec says, it is ignored. Whether the sending of the message will be a part of a transaction depends on the transaction type of the bean. That is what the spec says, "the container manages the transactional enlistment of JMS sessions on behalf of a bean"
If you like our products and services, please help us by posting your review here.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.421 :

Post by himaiMinh »

I see.
Like one of the questions:

Code: Select all

ut.begin();
   //send the message to the queue here.....
   
ut.setRollback();

The sending of the message is part of the bean managed transaction.

Or, in CMT, sending is not in a transaction:

Code: Select all

 @TransactionAttribute(NOT_SUPPORTED)
 void send (){

   //send message to a queue
 }


Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests