Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setRollbackOnly()

 
Sandesh Tathare
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I came across following statement in Tips and Tricks for BCD exam:
If setRollbackOnly() is successfully invoked, you cannot say whether the bean uses CMT or BMT.
However, one can very well understand whether bean uses CMT or BMT based on the Object type on which setRollbackOnly() method is called in source code. If UserTransaction.setRollbackOnly() is called, bean uses BMT and if EJBContext.setRollbackOnly() is called, bean uses CMT.

Am I missing something here? :roll: Pls clarify.

Regards,
Sandesh
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What this says is that if you see a code excerpt where UserTransaction.setRollbackOnly() is called, you can be sure that the bean uses BMT. Similarly, when you see EJBContext.setRollbackOnly() being called, you know you have a bean using CMT in front of you.

Hope this helps
 
Sandesh Tathare
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Valentin,

I understand what you are saying and that's the same stuff I've put in my original question.

Let me quote my question again:
I came across following statement in Tips and Tricks for BCD exam:
Tips and Tricks says:
If setRollbackOnly() is successfully invoked, you cannot say whether the bean uses CMT or BMT.

Now following are MY views:
However, one can very well understand whether bean uses CMT or BMT based on the Object type on which setRollbackOnly() method is called in source code. If UserTransaction.setRollbackOnly() is called, bean uses BMT and if EJBContext.setRollbackOnly() is called, bean uses CMT.

So the question here is whether Tips and Tricks statement is wrong or there's a point they are trying to make, which we don't know.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I see and I admit that the first sentence is badly worded. Actually, what it is supposed to mean is that if you see the method setRollbackOnly() somewhere in the exam without any hints about the type of the object the method is invoked on, you cannot infer anything about what transaction demarcation type (BMT or CMT) the bean uses.

Since I'm the person responsible for this error, I will rephrase the sentence and inform Whizlabs to update the simulator.

Sorry for the inconvenience this may have caused
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic