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 HFEJB: Pg 516, Question# 1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "HFEJB: Pg 516, Question# 1" Watch "HFEJB: Pg 516, Question# 1" New topic
Author

HFEJB: Pg 516, Question# 1

Keerthi P
Ranch Hand

Joined: Aug 19, 2003
Posts: 203
Which are true about transactions in EJB 2.0 ?

A. ...
B. ...
C. ...
D. A bean instance can run multiple transactions in parallel.
E. A message-driven bean instance must complete a transaction before the 'onMesssage' method returns.

Correct Answer: E

I think D and E are the correct answers. Ofcourse, a stateful session bean instance cannot run multiple transactions in parallel(1 client -> 1 bean instance). But an entity bean instance can, because the same instance of an entity bean can be shared by two or more clients at the same time, which means there can be multiple transactions (initiated by each of the clients) running in the instance. Shouldn't the option D be more specific as to what the bean type is - session or entity?

Can someone please clarify?
[ February 10, 2005: Message edited by: Keerthi P ]

Cheers.<br />Keerthi<br />(SCJP, SCWCD, SCBCD)
Jeff Walker
Ranch Hand

Joined: Apr 25, 2004
Posts: 116
Originally posted by Keerthi P:
Which are true about transactions in EJB 2.0 ?

A. ...
B. ...
C. ...
D. A bean instance can run multiple transactions in parallel.
E. A message-driven bean instance must complete a transaction before the 'onMesssage' method returns.

Correct Answer: E

I think D and E are the correct answers. Ofcourse, a stateful session bean instance cannot run multiple transactions in parallel(1 client -> 1 bean instance). But an entity bean instance can, because the same instance of an entity bean can be shared by two or more clients at the same time, which means there can be multiple transactions (initiated by each of the clients) running in the instance. Shouldn't the option D be more specific as to what the bean type is - session or entity?

Can someone please clarify?

[ February 10, 2005: Message edited by: Keerthi P ]



You cannot easily answer this question by reading HF-EJB. You need to read the ridiculously large (572 pages!) EJB 2.0 specification.

Assuning your analsis about session beans is correct (I believe it is), let's concentrate on entity beans. On page 187 of the spec, at the bottom, the answer is potentially given.

...
"The container activates multiple instances of the entity bean, one for each transaction in which the entity object is being accessed."
...

This statement implies multiple entity bean instances for each transaction started. By implication, one transaction can be run per bean.

I'd hate to take the above quote out of context, but I do believe this is the justification for E. being the only correct answer to the question.
-jeff walker

(This brings up my point from previous posts, that HF-EJB is not sufficient to answer the deep questions about EJB, like this one. It is a good book to pass the exam, but not to score high in the exam).
Keerthi P
Ranch Hand

Joined: Aug 19, 2003
Posts: 203
Thanks Jeff. I agree with you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HFEJB: Pg 516, Question# 1
 
Similar Threads
soft scbcd test questions?
ICE 287 answers for WebSphere 5.0
Mock questions required answers
sample questions
Long Awaited - Answers to batches #2, #3, #11