Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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

Valid operation in ejbCreate for stateless session bean

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can a statless session bean acess EJBObject in ejbCreate method ? The EJB specification lists getEJBObject and getEJBLocalObject under operations allowed in ejbCreate method.

I am under the impression that EJBOjbect is created when the client invokes create method on home. For a statless session bean however, ejbCreate could be invoked much earlier for a stateless session bean unrelated to any calls from the client.

So, how can getEJBObject be a valid operation in ejbCreate for a statless session bean ?
 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i've got your point. and confuse too

adding in your concern, there's an evident to this case on Object Interaction Diagram in page 227 HFEjb.
ejbCreate() is called at a completly different/unrelated time with client's create(). so it can be assume that there's no EJBObject.

can anyone explain this?
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kathy's answer
 
Rudy Harianto
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adrian Pang,
Thanks for the link. It really helps.

But now i've got another doubt about ejbCreate/ejbRemove from stateless session bean.
From HFEjb page 228, it cannot call getUserTransaction() method. But according to spec page 90 on table 3 (column BMT) it can.
Which one is right?
 
This cake looks terrible, but it tastes great! Now take a bite out of this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic