Originally posted by Kengkaj Sathianpantarit:
Never, Supports, RequiresNew are not make sense, because there isn't pre-existing transaction context for MDB.
Never throws Exception if there is pre-existing transaction context, but that don't ever occur (Use Never for what? Why don't use NotSupported)
If there is pre-existing transaction context, Supports will run in that TX context (There is NO! So, what is the point to use Supports?)
RequiresNew always run in new transaction context, but this behavior is always the same to Required. Why we need 2 attributes that always effect the same?
[ February 21, 2006: Message edited by: Kengkaj Sathianpantarit ]
Thanks for the reply
Let's see if I understand correctly:
- Never is not allowed because we don't need its special feature, which is to throw an Exception (or Error?) if called within a transaction - which never occurs
- Supports is not allowed because we don't need its special feature, which is to join a transaction if it exists, or run unspecified if not exists
- RequiresNew is not allowed because we don't need its special feature, which is to always start a new transaction
Seems to me that Required is chosen arbitrarily, since we don't need both... could just as easily have been
"- Required is not allwoed because we don't need its special feature, which is to join an ongoing transaction if it exitst, or create a new one. "
RequiresNew is, according to the MasteringEJB book (p.296), for "if your bean needs the ACID properties" which I would think an MDB would want.
Don't mean to be difficult here, just trying to understand and not just memorize...
[ February 21, 2006: Message edited by: �dne Brunborg ]