I can't agree on that.. All Runtime Exceptions are not System Exceptions,
By "usually" I meant those runtime exceptions that are not application exceptions. But of course you're right: It's always better to use the terms "application exception" and "system exception".
so I think that in this case the message will not be deleted from queue
The core spec, 5.4.12 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 demarcation with the REQUIRED transaction attribute must be used.
Note: Queuing systems work in a transactional way. So if in BMT the physical removal of the message from the queue would depend on the result of the user transaction you would need an outer transaction handling the queue and spanning the inner user transaction. But there is no requirement for nested transactions in
ejb.
By the way, using a simple message consumer you can easily check that in the questionable BMT scenario there is no message in the queue after a system exception occured in the MDB.
Regards
Ralph
---------------------------------
SCJP 5.0 (98%)
[ November 02, 2008: Message edited by: Ralph Jaus ]