Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubts on answers for Q 5,Q15 in Chapter 6

 
muthu kumaran
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am not sure about the correct answers for Q5 and Q15 on chapter 6 of HFEJB

Q5) What are legal declarations for a CMP bean
The option B is right , but what is wrong with Option D

public int ejbCreate() throws CreateException

Q15) Which methods are always called in direct response to a client operation?

The options B) ejbCreate C) ejbRemove have been marked right
But option D) ejbActivate is left out. why is it so?

ejbActivate is called only on response to a client invoking some method and not by the container whenever it wants to ..

Can anyone throw some light on this?

Thanks,
Muthu
 
Herman Schelti
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Muthu,

Q5 answer D is not correct, because this method has to retunr the primary and the primary key has to be a class, not just a primitive. Integer instead of int would have been OK.

Q15 answer D is not correct, because the client cannot call the ejbActivate() method on the bean.

Hope this helps,
Herman
 
muthu kumaran
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Herman for the response. I am clear with the first one, but not clear with the second one.

ejbActivate will not be called by the client directly as is the case with ejbCreate too.

The question was which methods wud be called on direct response to a client's action and 'ejbActivate' also fits that role..

Thanks,
Muthu
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic