Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling Entity Bean from SessionBean  RSS feed

 
HASAN SIF
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!