• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

HFEJB Page 371, Q# 18

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
I am totally lost on this question.

Question asks which methods run in the tx ctx of caller method
1. ejbLoad
2. ejbRemove
3. ejbSelect
4. ejbActivate
5. ejbPassivate
6. setEntityContext

To my understanding all of 6 options are correct but books says only 1, 2 and 3 are correct.

Can anybody help me?
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aatir,
I think the book's answer is correct.
Because as for ejbActivate(), ejbPassivate(), setEntityContext(), whithin this three methods there's no valid Tranaction context. Please take a look spec Page 80 (for stateful Session Bean), Page 180 (for Entity Bean), since no valid tx ctx within these methods, of course 4, 5, 6 are wrong, while in the 1, 2, 3 methods, valid tx ctx are there.
since MessageDriven Bean and stateless bean has no ejbActivate(), ejbPassivate(), so we don't need to concern this two types of bean here.

Hope it can help you.

Hai
 
Aatir Ahmed
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Lin for your help. Your help is greatly appreciated.
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i was wondering why ejbRemove() is correct?

in spec page 79, it says "The ejbRemove() method cannot be called when the instance is participating in a transaction. An attempt to remove a session object while the object is still in a transaction will cause the container to throw the javax.ejb.RemoveExcetption to the client."

The original question was: Which method(s) run in the transaction context of the method that causes their invocation?

(maybe i understand question wrong?)

**hmm.. or is it talking about Entity beans only
[ August 01, 2004: Message edited by: Ryan Wong ]
 
WARNING! Do not activate jet boots indoors or you will see a tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic