• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic