Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Talk:EclipseLink/Examples/JPA/Multitenant
Revision as of 21:48, 29 September 2011 by Wrschneider.gmail.com (Talk | contribs) (New page: I'd love to see an example of how this would look end-to-end with a container managed environment - i.e., how would you incorporate multitenancy into a managed bean (JSF, EJB etc.) current...)
I'd love to see an example of how this would look end-to-end with a container managed environment - i.e., how would you incorporate multitenancy into a managed bean (JSF, EJB etc.) currently using @PersistenceContext?
I suppose you could inject a @PersistenceUnit instead, but then how would you manage the EntityManager lifecycle? @PersistenceContext does it all for you. If you do something like call EntityManagerFactory.createEntityManager(map) in a @PostConstruct method, when do you close it? How does it participate in transactions? etc.