aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes doubt on Q4 and Q6 on Chap 11 HFEJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "doubt on Q4 and Q6 on Chap 11 HFEJB" Watch "doubt on Q4 and Q6 on Chap 11 HFEJB" New topic
Author

doubt on Q4 and Q6 on Chap 11 HFEJB

muthu kumaran
Ranch Hand

Joined: Oct 26, 2004
Posts: 56
The question Q4 goes as which methods can call 'isCallerInRole' for a stateful session bean

Options that are shown as right ones are

ejbCreate,ejbActivate,ejbPassivate


The question Q6 goes as which methods can call 'getCallerPricipal'for a CMP entity bean

Here it says 'ejbActivate' and 'ejbPassivate' cannot call the above said method as there is no client associated with the bean.

Although the spec also says the same , I am not able to understand this.

How come a session bean would be associated with a client during 'ejbActivate' and 'ejbPassivate' when an entity bean cannot ?

Could anyone throw some light on this ?

Thanks
cheenu Dev
Ranch Hand

Joined: Nov 13, 2005
Posts: 276
for stateful session bean client is tied to bean instance.
that way both methods can get the security info can be got.
but for entity beans ejbPassivate() means the bean is goin to pooled stated.it does not differ which client called its methods...after the methods end it goes to pooled state (also multiple clients can acces a bean instance concurrently)..so which client security info???
for ejbActivate it is way more clear..before having a client associated how can you get clients security info?

hope this is clear.


cheenujunk@gmail.com
muthu kumaran
Ranch Hand

Joined: Oct 26, 2004
Posts: 56
Thanks Cheenu..
So in the case of session beans(Stateful) passivation is just taking the
bean out of memory and placing it somewhere . The bean still holds the client state , whereas in the case of entity beans , the bean is disassociated from the data it is holding and goes to the pool ...
cheenu Dev
Ranch Hand

Joined: Nov 13, 2005
Posts: 276
obviously,correct.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: doubt on Q4 and Q6 on Chap 11 HFEJB