• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Doubts in Chapter-6 HF-EJB

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
 
This will take every ounce of my mental strength! All for a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic