my dog learned polymorphism*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes acknowledge-mode in MDB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "acknowledge-mode in MDB" Watch "acknowledge-mode in MDB" New topic
Author

acknowledge-mode in MDB

cyril vidal
Greenhorn

Joined: Nov 02, 2004
Posts: 14
Hi,

I read in HFE p.460 as well as in spec 15.4.8 p.317 that if the message driven bean uses container managed transaction demarcation, message acknowledgment is handled automatically as a part of the transaction commit. (that is, if I unserstand well, if transaction commits, the receipt will is acknowledged by the container and if the transaction fails, no receipt and the JMS provider will resend the message).

But, as far as I know, it's allowed to specify two attributes for a transaction in CMT: Required and NotSupported.
For Required, what the spec explains is OK, because there's a valid transaction context.
But if NotSupported is specified, there's no valid transaction context present and I don't understand how in this case, acknowledgment should be tied to the transaction.
In this case, should'nt we use the tag <acknowledge-mode> too, as we do for BMT?

Thanks for youe responses,
Regards,
Cyril.
[ November 15, 2004: Message edited by: cyril vidal ]
Aneesha Singh
Ranch Hand

Joined: Jan 14, 2002
Posts: 47
I thought that in case of NotSupported, the acknowledgement depends on if the method completed properly or threw an exception.
sandeep vaid
Greenhorn

Joined: Jul 08, 2004
Posts: 20
I think there is nothing in EJB 2.0 related to NotSupported and
auto-aknowldege
But we know the NotSupported is unspacifed transaction context and for this type of Trancsation context the EJB 2.0 does not have proper specification how container should implement this unspacified context see 17.4.1 of ejb specs and 352 page for this.

So when we chose the MDB with the Unspacifed tracsaction context we are not going for the assured message processing after delivery in onMessage() so here the Transaction acknowlege-mode dose not play part in case of CMT.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: acknowledge-mode in MDB
 
Similar Threads
JBoss Messanging: keeping message in inbox queue until it will be processed successfully - possible?
Transaction in MDB
MDB acknowledge in CMT, with onMessage() declared NotSupported?
Doubt on Enthuware mock regarding MDBs
Need help in MDB