Cheers,<br />Reghu Ram T<br /> <br />SCJP 1.4 - 98 %, SCBCD 1.3 - 94 %, SCMAD 1.0 - 92 %
Originally posted by Reghu Ram T:
But my doubt is that since transactions are not allowed to propagate into BMT code, the transaction must have been started only in the BMT Code. So why cant we just call rollback() instead of setRollbackOnly() ?
Even Kathy has mentioned that she can't think of many good reasons for this.
The following excerpt is from Kathy's post at https://coderanch.com/t/157891/java-EJB-SCBCD/certification/When-UserTransaction-setRollbackOnly-UserTransaction-rollback
"And why would you use it? Because you might know the transaction is going badly *before* you reach the place where the transaction actually ends. You might not want to end the tx at the moment you discover it won't work, for many reasons. Perhaps you want to keep only one place in your code where the transaction ends. Or... you might need the rest of the transactional code to run for other side-effects, who knows.
(I have a hard time coming up with good reasons) "
Cheers,<br />Reghu Ram T<br /> <br />SCJP 1.4 - 98 %, SCBCD 1.3 - 94 %, SCMAD 1.0 - 92 %
Originally posted by Reghu Ram T:
Hi Vish,
I was talking about the rollback() method in the UserTransaction interface.![]()
Anyway i had read Kathy's comments and only wanted to know if anyone could come up with more reason's for that ?
Hot dog! An advertiser loves us THIS much:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|