• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HFEJB: Pg 516, Question# 1

 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jeff. I agree with you.
 
reply
    Bookmark Topic Watch Topic
  • New Topic