• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Doubt on ejb-ref tag..

 
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Is it necessary to define the bean in <ejb-ref> tag, when ever i am referrring the bean? Is for cmr fields also?
I am sure the above two questions might not be understandble, hence i am explaing with the examples..
I am having the MovieBean, DirectorBean.
In the MoviewBean, i am having <cmr-field> on DirectorBean.
In the MovieBean to set the DirectorID(which is primary key of DirectorBean), i will query the jndi lookup for DirectorBean home from that i will get the DirectorBean EJB Object and will use the same to set DirectorID.
Now my question is to refer the DirectorBean from MoviewBean -- Is it necessary to refer the DirectorBean in <ejb-ref> of DD of MovieBean section or not.

Thanks in Advance,
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No it is not necesary to use the ejb-ref tag in the case you have mentioned. It is just a way for the developer to use the reference of a bean even if he/she does not know the actual JNDI name of the referenced Bean. Like in your example if you want to access DirectorBean from MovieBean and you don't know the JNDI name of the DirectorBean then you can use the JNDI name "java:com/env/ejb/Director" and in your deployement descriptor you can mention in the MovieBean - <ejb-ref><ejb-ref-name>ejb/Director</ejb-ref-name></ejb-ref>

Later on the Application assembler can insert the tag <ejb-link>DirectorBean</ejb-link> in the ejb-ref tag.

I hope i'm clear.
 
Replace the word "snake" with "danger noodle" in all tiny ads.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic