aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Enthuware questions 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 "Enthuware questions" Watch "Enthuware questions" New topic
Author

Enthuware questions

Nikhil Jain
Ranch Hand

Joined: May 15, 2005
Posts: 385
Which of the following are true regarding a bean with bean managed transaction demarcation?

One of the options to this was
If it is a message-driven bean, it must commit a transaction (if it exists) before its message listener method returns.

The explaination given was
This is not fully true. A message driven bean may commit the transaction even in a timeout callback method.

Is this possible?


Secondly, there are loads of tiny details in this exam. Is the exam going to be this tough?


SCJP 1.4, SCWCD 1.4, SCBCD 1.5
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Core specification, 13.3.3 Enterprise Beans Using Bean-Managed Transaction Demarcation

A message-driven bean instance must commit a transaction before a message listener method or timeout callback method returns.


[My Blog]
All roads lead to JavaRanch
Nikhil Jain
Ranch Hand

Joined: May 15, 2005
Posts: 385
But does this mean that transaction was started in onMessage & commited in Timeout.??
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Yes
Mirko Bonasorte
Ranch Hand

Joined: May 14, 2007
Posts: 244
Hi,
I'm not sure about that: the specs say that a stateful session bean may commit a started transaction before the business method returns.
Instead, for stateless session bean/mdb I suppose that it means that if I create a transaction in a business method, I have to commit before return.
The same is for timeout callback methods.

Finally, in 13.6.1, the specs say:

If a stateless session bean instance starts a transaction in a business method or interceptor method, it must commit the transaction before the business method (or all its interceptor methods) returns.


I hope this helps


SCJP<br />SCWCD 1.4 Upgrade (Remember: me stupid)<br />SCWCD 1.4<br /><a href="http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html" target="_blank" rel="nofollow">SCBCD 5.0</a><br /><a href="http://www.enthuware.com" target="_blank" rel="nofollow">SCBCD 5.0 mock exam</a> <br /> <br />SCEA 5 Part1: Preparing...
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Mmmhh, forget by previous "yes". Thinking about it twice, it does not seem possible. By the way, when a timeout happens in a MDB, in which transaction context will the timeout callback run ? Unspecified transaction context ?
Mirko Bonasorte
Ranch Hand

Joined: May 14, 2007
Posts: 244
According to what I remember, timeout callback transaction rules are the same as a business method, except for the fact that, in case of container managed transaction, it can be only REQUIRED, REQUIRES_NEW and NOT_SUPPORTED.
Nikhil Jain
Ranch Hand

Joined: May 15, 2005
Posts: 385
Thanks, but the option to the question was so confusing. I hope the questions in the real exam are clear & crip!!
 
 
subject: Enthuware questions
 
Similar Threads
Wrong Enthuware Answer
Wrong answer/explanation in com.enthuware.ets.scbcd.v5.2.161
MDB throw system exception
Regarding MDB
When CMT bean commit?