• 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
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

doubt on Q4 and Q6 on Chap 11 HFEJB

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
muthu kumaran
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
obviously,correct.
 
reply
    Bookmark Topic Watch Topic
  • New Topic