posted 20 years ago
There's no client on message driven beans. The bean is created by the container and at that point, there is no transaction. The choice is do you want your onMessage() method to run in a transaction, or not. Both before and after that method, there's no transaction.
So if you want it in a transaction, you choose "Required". Although "RequiresNew" would theoretically do the same thing, it would be redundant because the difference between "Required" and "RequiresNew" occurs when there IS a transaction status before the method (and we just said that wouldn't happen). And without a transaction status beforehand, Mandatory would throw an exception, so that one makes no sense.
If you do not want your onMessage to run in a transaction, you theoretically could choose any of "Supports", "NotSupported", or "Never", but "NotSupported" is the one that best describes what you want to happen, and so was the one the designers chose. I think this choice is somewhat arbitrary but "NotSupported" is the best choice because even outside of message driven beans, "NotSupported" always runs in an unspecified transaction context no matter what the previous transaction status is (you can't say that about the other choices).
--Dale--
[ April 19, 2004: Message edited by: Dale Seng ]