About Question com.enthuware.ets.scbcd.v5.2.297 :

Moderator: admin

Post Reply
ETS User

About Question com.enthuware.ets.scbcd.v5.2.297 :

Post by ETS User » Wed Mar 23, 2011 3:06 pm

In explanation to this question is stated that when BMT MDB would throw a system exception the message would be redelivered. I thought that message redelivery only occurs when message was dequeued in transaction, which can't happen in BMT MDB. So, redelivery mechanism works for any type of transaction management when MDB throws system exception?

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

Re: About Question com.enthuware.ets.scbcd.v5.2.297 :

Post by admin » Thu Mar 24, 2011 7:54 pm

As per the specification, yes, the message receipt is not part of the transaction in case of BMT MDB. It says, "When a message-driven bean using bean-managed transaction demarcation uses the javax.transaction.UserTransaction interface to demarcate transactions, the message receipt that causes the bean to be invoked is not part of the transaction. If the message receipt is to be part of the transaction, container-managed transaction demarcation with the REQUIRED transaction attribute must be used."

It also says that in case of a system exception from a BMT MDB, the container takes the following actions:
"Log the exception or error.
Mark for rollback a transaction that has been started, but not yet completed, by the instance.
Discard instance.
Throw EJBException that wraps the original exception to resource adapter. "

Though it does not say anything about whether the message would be redelivered, I think since the message receipt is not a part of the transaction, it would not be redelivered. It would have helped if the specification had made it clear.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests