Win a copy of React Cookbook: Recipes for Mastering the React Framework 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Different interfaces in EJB 3.0

 
Greenhorn
Posts: 5
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I just read about interfaces in EJB. What I have read is : There are two interfaces in EJB. The first one is "Home interface" which contains life cycle methods of a bean and upon "create" method invocation , it gives a reference of second interface i.e. "remote interface" which contains business methods. Can you guys please throw some light on other interfaces like local , local home....Actually these things are creating lot of confusion. Please write about all interfaces.
 
author & internet detective
Posts: 40722
827
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are almost there. Home and Remote are the "original" interfaces to look up and call an EJB. Local Home and Local were added later for when remoting was needed (like when your ejb and caller are in the same server.). They have the same purpose as the remote versions; just without actually being remote.
 
Vaibhav Bhardwaj
Greenhorn
Posts: 5
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So can we say that if I need to call an entity bean from a session bean (now client(session bean) and target bean(entity bean) are in same server i.e. EJBContainer ) then I will have to look up for "LocalHome" interface and from its reference , I should make a call to create() which will give me a reference of "Local" interface (which contains entity beans methods and this interface is implemented by Entity bean).
So "Remote interface" belongs to "Local interface" and "Home interface" belongs to "LocalHome interface".

May be there is performance improvement using LocalHome and Local interface but here also we need to use lookUp mechanism to find LocalHome interface mechanism. Please throw some light on my understanding.
 
Ranch Hand
Posts: 38
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your Local and Remote interfaces are COMPONENT interfaces. they act like proxies for your beans. Home interfaces are used to create reference to component interfaces. In EJB 3.0, Home interfaces are not required, you just need component interfaces for your Beans.
It would be better if you try some books on EJB 3.0 (EJB 2.x is almost deprecated, so look for books on EJB 3.0 or EJB 3.1)
 
You ridiculous clown, did you think you could get away with it? This is my favorite tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic