• 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
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Calling Entity Bean from SessionBean

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Need to call entity bean from session bean to do some business logic upon some stored data. What should be the process of doing it.
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, the exact technical procedure for doing it depends on what
EJB server you are using, but basically, a session bean can act
as a client of an entity bean. It simply accesses the entity bean
exactly the same way as a regular client. It does a lookup on the
entity bean's home interface, then gets a handle on the entity
bean's remote interface, then invokes any methods it wants from
the entity bean's remote interface. The only difference is in the
entity bean's home interface lookup. A regular client needs to
use JNDI to do the lookup, but some EJB servers have a special
method to do the lookup when a session bean wants to contact an
entity bean (since both java classes are in the same JVM -
usually).
Your EJB server documentation should have examples of how to a
session bean can act as a client for an entity bean.
Good Luck,
Avi.
 
All of the following truths are shameless lies. But what about this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic