File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes setRollbackOnly() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "setRollbackOnly()" Watch "setRollbackOnly()" New topic
Author

setRollbackOnly()

Sandesh Tathare
Ranch Hand

Joined: Jun 22, 2003
Posts: 82
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


Regards,<br />Sandesh<br />(SCJCP, SCWCD, SCBCD - 99%, OCP-1)<br /> <br />Either find a way or create one.
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
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


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Sandesh Tathare
Ranch Hand

Joined: Jun 22, 2003
Posts: 82
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

Joined: Aug 26, 2001
Posts: 7610
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setRollbackOnly()