• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

setRollbackOnly()

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
CAUTION! Do not touch the blades on your neck propeller while they are active. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic