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

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.
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic