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.
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