Howdy -- if a transaction begins within the context of another *active* transaction, you would have a 'nested' transaction (which as you know is not allowed in EJB). In other words, if you start transaction A, and then start transaction B, without ending transaction A, then you have a nested transaction, where transaction A and B might affect one another. For example, if A rolls back, what happens to its child transaction B? And if B rolls back, what should happen to its parent transaction A? These issues are avoided in EJB, because you can have only FLAT transactions, where two different transactions do not have direct affect on one another.
You CAN have more than one transaction underway, in the case of "RequiresNew" or when a BMT bean begins a transaction, but in both of those cases, the caller's transaction is SUSPENDED. In other words, the caller's transaction STOPS being the active transaction context, and has nothing to do with the new transaction. The caller's suspended transaction simply picks up again when the method it called is popped off the stack and it moves on to its next step...
So with EJB flat transactions, there is never more than ONE transaction that is *active*, so no two transactions are ever related to one another. One transaction must END, or be SUSPENDED, before another begins. The Container will automatically suspend a transaction if the called method has a transaction attribute of RequiresNew, or if the bean is a BMT bean. Remember, BMT beans will NEVER use an incoming transaction context from the caller. BMT beans can run in ONLY their own transactions.
cheers,
Kathy
