Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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

Why not getCallerPrincipal in ejbActivate and ejbPassivate?

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got problem with question 6 at page 594 with answers at page 597 in HF EJB. What disturbs me is why I can�t call getCallerPrincipal in ejbActivate and ejbPassivate? But on the other hand CAN do it in ejbCreate!

This is a confusing for me because in the ejbCreate do I NOT have access to the EJBObject yet because it is not created until the entity have been created in the DB which is shown clearly at page 329, but I yet HAVE access to security information about the client according to page 338. Okay, I can accept that because there is a client that is currently creating a new entity. But then is it confusing that I NOT have access to the information about the user, that is can call getCallerPrincipal, in ejbActivate and ejbPassivate because there do I HAVE access to the EJBObject and the entity bean is going to or has just been executing for a specific entity. Therefore can I not find a clear good reason to why I not can call getCallerPrincipal in ejbActivate and ejbPassivate and therefore is it also hard to memorize that I can�t do it.

So can anyone give a clear good non-confusing reason to why I can�t call getCallerPrincipal in ejbActivate and ejbPassivate despite I can do it in ejbCreate please?!
[ June 24, 2007: Message edited by: Jonny Andersson ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic