Why <ejb-local-ref>?


EJB design: Why <ejb-local-ref>?

  1. Why <ejb-local-ref>? (3 messages)

    In ejb-jar.xml, what's the reason for the <ejb-local-ref> under <session>?

    The entity beans referenced are listed on their own in ejb-jar.xml so this seems to me to be duplication. Or is it just an option allowing different beans to be used by the session bean. And is it required (it seems to work ok without it).

    thanks - dave

    Threaded Messages (3)

  2. Why <ejb-local-ref>?[ Go to top ]

    <ejb-local-ref> tag is used since EJB 2.0 to indicate local lookup beans. This means that EJB is looking to another resource in the same container only. This has been introduced to avoid expensive Remote look up calls that was mandatory earlier, even if two EJBs are lying in same container.
  3. Why <ejb-local-ref>?[ Go to top ]


    But I've found I can do a local lookup without this entry. (Is it that my J2EE server handles this even though it's not required?)

    thanks - dave
  4. Why <ejb-local-ref>?[ Go to top ]

    According the spes, the <ejb-local-ref> is required. Some servers allow you to do the lookup without it, though. If you want to comply with the specs, always use <ejb-local-ref>.