Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFEJB page 366 question no 18

 
mohd. gulrez khan
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a Doubt in question no 18 on page 366 of HFEJB.

As far as My understanding goes, transaction context of a method of a bean (irrespective of its BMT OR CMT ) which invokes another method of a CMT Bean is propagated to the invoked method.

So the answer to this question should include all the method which Run as a CMT bean Methods.Now , since an Entity Bean can only use CMT , all the methods given as options should be a part of the answer.

I do not get why only A,B and C is the answer to this question.

Any help is appreciated.

Thanks,
[ February 24, 2006: Message edited by: mohd. gulrez khan ]
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are asking why ejbActivate, ejbPassivate and setEntityContext do not run in the caller's transaction context. For setEntityContext: ask yourself if a client will exist when this method is called.
 
mohd. gulrez khan
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
perfectly true and acceptable.

But why not ejbActivate() and ejbPassivate()

Thanks in Advance
 
Ramakrishnan Viswanathan
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds logical that ejbActivate() and ejbPassivate() methods would get called in response to a client request. However, there are situations where these methods might get invoked by the container. An entity bean can receive a series of passivation and subsequent activation calls while it is in a transaction. This is comlpetely at the discretion of the container. What is guaranteed however, is that the bean always gets an ejbStore() call prior to passivation.

These callbacks do get called as a result of client invocation - but not "always"...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic