Simple; CMT can not be demarcated by the bean developer. In CMT a method specified in a transaction attribute is wholly involved in the trnsaction but in BMT the programmer can demarcate a transaction - he gets the transaction with a command such as ut = context.getUserTransaction() the transaction starts when he issues the command ut.begin(). He could decide not to commit or rollback the transaction in the same method, rather he does that in a different method. Now the down side is one can not say for sure which of the methods is going to be called first.
posted 16 years ago
Anselm Paulinus, your answer focus on BMT, but my question is mainly about CMT - the main sentence.
The client can call a method (on a CMT bean), and it might start a transaction. The bean might even call other methods that start other transactions (but no nested transactions, of course). In the end, when that original method from the CMT bean ends, there must be no transactions open. The container manages that. Think about your DD.... you had to tell it to use CMT for that bean. You also had to tell it how you wanted it to handle transactions (Required, Not Supported, etc). There's nothing in the DD to say "leave this one open at the end of the method", right? --Dale--
Too many men are afraid of being fools - Henry Ford. Foolish tiny ad:
Devious Experiments for a Truly Passive Greenhouse!