Discussions

EJB design: Service Locator in Pet Store/Blueprints

  1. Service Locator in Pet Store/Blueprints (1 messages)

    Why does the EJB tier Service Locator pattern not cache and is not a singleton? Wouldn't the benefits of having a singleton and caching also benefit for the EJB tier as it does for the Web Tier? Thanks
    -od
  2. Hi!

    Many client threads can use the same service locator class at the same time. If it is implemented as a Singleton, this means many threads can access the same EJB at the same time. And this is an error accroding to the spec!

    /Tomas