Hello guys,
This is what i have understood.
The setRollbackOnly() method is used to doom a transaction which was started by someone else because we can call rollback() method to doom a transaction we started.
The setRollbackOnly() method called on the EJBContext object, will mark the transaction which was propagated into the CMT ( a transaction started by some other transaction participant ) for rollback.
But the setRollbackOnly() method in javax.transaction.UserTransaction interface can be called within BMT code to set the transaction to be marked for rollback.
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() ?
In Mastering
EJB by Ed Roman ( page no : 305 ) , Its given that �if the transaction participant is not an EJB Component such as a
Java Object, we can doom the transaction by looking up the JTA and calling the JTA�s setRollbackOnly() method�.
I am not able to understand what is transaction participant that is a non EJB Component like a Java Object and how can it be included in a transaction?
Even after reading Kathy's explanation, i am not able to get a good reason why rollback() cannot be used in BMT insted of setRollbackOnly(). Can any one help me on this ?