• 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
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Doubts in Chapter-6 HF-EJB

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 6 - Entity Bean Synchronization - Mock Exam..

Ques 15 :
Which method(s) are always invoked in direct response to a client operation?

The choices are ejbLoad, ejbCreate, ejbremove, ejbActivate, ejbPassivate, setEntityContext..

The answers given in the book are : ejbCreate, ejbRemove..

But ejbActivate is called in response to a client operation..So shouldn't it be also an answer?Moreover, the comment given for that answer in that book says that Load, Passivate and setEntityContext can be called by the container when it wants it..Is it an errata in the book?

Ques 9 : Which method(s) from the EntityContext interface can be invoked from within the ejbCreate method?

The choices are : getEJBHome, getEJBObject, getCallerPrincipal, getUserTransaction, setRollbackOnly.

The answers given are : getEJBHome, getEJBObject, getCallerPrincipal, setRollbackOnly..But EJBOBject gets created only after ejbCreate method completes..So should the answer have getEJBObject??

In page no # 338, it says that "get a reference to your EJB Object" is not allowed in ejbCreate..Please clarify..
 
cowbird
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ques 15 :
ejbActivate is called when a client calls a business method, and ajbPassivate after the method returns. But I think the container is allowed to keep the bean activated after a business method. So then no passivation or activation happens between two business methods... The container can passivate and activate when he decides... Can anyone confirm this?


Ques 9 : Which method(s) from the EntityContext interface can be invoked from within the ejbCreate method?

getting a reference to your EJB Object is indeed not allowed in ejbCreate, seems like an error...
 
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

On question :-

"Which method(s) are always invoked in direct response to a client operation?
The choices are ejbLoad, ejbCreate, ejbremove, ejbActivate, ejbPassivate, setEntityContext.."

Remember one thing ejbLoad,ejbActivate,ejbPassivate,setEntityContext are container callbacks methods and container can call anytime without client interaction means container is not dependent on client to call these method,depending on the container implementation,Container can call them.

And while ejbCreate,ejbRemove are only called by container when client invokes create and remove methods on remote interface.

I hope above explaination will help and Question 9 answer is wrong in the book,if u search in this forum only,you will find thread mentioning that.

Regards,

James
[ June 09, 2004: Message edited by: james edwin ]
 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question No. 9 answer B is incorrect and it was corrected in the book authors errata page. Go thru the errata url given below.

http://www.oreilly.com/catalog/hfjejb/errata/

regards
Sree Nivas
 
machines help you to do more, but experience less. Experience this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic