• Post Reply Bookmark Topic Watch Topic
  • New Topic

a session bean contacts an entity bean  RSS feed

 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when a session bean wants to contact an entity bean,
it does not use JNDI to do the lookup. What kind of
way it should use? Does it depend on type of Server?
What if I use Weblogic Server? Could someone show me
that piece of code?
Please help ASAP!
Thanks in advance,
Sarah
 
Madhu Juneja
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Calling of a entity bean from a session bean is not app server dependent. If a session bean needs to invoke methods of entity bean, it has to do in the same standard way. It does have to use the JNDI lookup too. And you can of course use weblogic server.
For example :

The above is session bean. The client invokes the calcBonus() method and this method creates an instance of Entity Bean, the code given as follows.

Also refer : http://www.javaranch.com/ubb/Forum11/HTML/000594.html
The link mentioned in the above has examples with various combinations of J2EE technologies.
HTH
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!