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

EJB lookup and Jboss SEAM

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I recently started reading Head First EJB and very quickly have been able to start understanding EJB.
One comon thing in EJB remote is use of lookup.
We use lookup to get the EJB home and from EJB home we can get EJBObject thats used to access the bean.
This is how it happens in EJB2.0 I am not sure how it happens in EJB3.0
The project i am working on uses SEAM and EJB3. I saw they are directly looking up the session beans using the Intitial Context.
The HOME classes are only there for entity beans and not session beans.
More over we are not even doing lookup for entity beans.
Simply from session bean we are doing
@In(create = true)
private MyEntityHome myEntityHome;

My question is why are we not doing lookup for the entity bean. Is it that since my session bean and entity bean are both at server so it can be treated locally ?
In that case when should i do lookup for entity bean?
Also why there is no HOME class for the session bean? How come we are directly doing lookup for the session bean. I it legal?
 
Time flies like an arrow. Fruit flies like a banana. Steve flies like a 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