0 Replies Latest reply on Dec 14, 2005 2:05 PM by yxw84

    Dynamic Injection of Entity Managers

    yxw84

      I read a 4-page long thread about this topic on this forum a few months back, and I'm wondering if there's been any update on dynamic injection of entity managers.

      The thead: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=65869

      I'm in the situation where I have a servlet invoking a stateless session bean which reads from potentially one out of several identical databases. The names of these databases have to be determined at run-time because they depend on the site which the user is accessing at any given point in time.

      So with sites:
      www.test.com
      www.random.com
      www.company.com

      The entity manager names are:
      www.test.com.EM
      www.random.com.EM
      www.company.com.EM

      From what I understand, injecting an entity manager only allows a constant for the @PersistenceContext unitName attribute. Is the functionality I need impossible to achieve right now?