HFEJB page 366 question no 18

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 ]

Gulrez<br /> <br />SCJP 1.4 , SCWCD 1.4.<br />SCBCD 1.3

Roger Chung-Wee

Ranch Hand

Posts: 1683

posted 10 years ago

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.

SCJP 1.4, SCWCD 1.3, SCBCD 1.3

mohd. gulrez khan

Greenhorn

Posts: 20

posted 10 years ago

perfectly true and acceptable.

But why not ejbActivate() and ejbPassivate()

Thanks in Advance

Gulrez<br /> <br />SCJP 1.4 , SCWCD 1.4.<br />SCBCD 1.3

Ramakrishnan Viswanathan

Ranch Hand

Posts: 90

posted 10 years ago

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"...